Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Creating a Relational Model | Data Foundations and Excel Essentials
Excel Formulas

Creating a Relational Model

Swipe to show menu

Right now, product pricing lives directly inside the Revenue calculation. In this chapter, move pricing into a separate table and connect both sheets using XLOOKUP.

Model Structure

  • Sales_Data: transaction data;
  • Products: product pricing data;
  • Product prices should live in a separate lookup table;
  • Pricing updates should happen in one central location.

This structure creates a single source of truth for product pricing.

XLOOKUP Structure

=XLOOKUP(lookup_value, lookup_array, return_array)
  • lookup_value: value being searched;
  • lookup_array: where Excel searches;
  • return_array: value returned from the matching row.
Note
Note

Formula argument separators in Excel may vary depending on your regional settings and Excel localization. Some versions use commas , while others use semicolons ;. If a formula does not work correctly, try replacing the separator accordingly.

Step 1 Create the Products Sheet
expand arrow

Create a new worksheet named:

Products

Add the following columns:

Product
Category
Cost
Price
Step 2 Add Product Data
expand arrow
ProductCategoryCostPrice
LaptopTech9001500
MonitorTech240400
KeyboardTech70120
MouseTech2540
PhoneTech480800
TabletTech360600
Step 3 Convert the Dataset into an Excel Table
expand arrow

Select the dataset and press:

Ctrl + T

Confirm the table contains headers.

Step 4 Create the First Lookup
expand arrow

Return to the Sales_Data sheet.

Inside H2, type:

=XLOOKUP(D2, Products!A:A, Products!D:D)
  • D2: product name;
  • Products!A:A: lookup column;
  • Products!D:D: return column.

Press Enter.

Step 5 Test the Connection
expand arrow

Change one of the prices inside the Products table.

Notice that the value updates automatically inside Sales_Data.

Step 6 Build the Revenue Formula
expand arrow

Replace the previous formula with:

=XLOOKUP(D2, Products!A:A, Products!D:D) * G2
  • XLOOKUP(...): retrieves the product price;
  • G2: units value.
Step 7 Clean the Dataset
expand arrow

Delete the temporary lookup-only column if needed. Keep only the final Revenue column.

1. Why is product pricing stored in a separate Products table?

2. What does Products!D:D represent?

3. Why is Revenue calculated using XLOOKUP instead of storing Price directly inside Sales_Data?

question mark

Why is product pricing stored in a separate Products table?

Select the correct answer

question mark

What does Products!D:D represent?

Select the correct answer

question mark

Why is Revenue calculated using XLOOKUP instead of storing Price directly inside Sales_Data?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 2

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 1. Chapter 2
some-alt