A relationship in Excel is a defined connection between two tables that links them through a common field, typically a unique identifier like a product ID or customer number. It lets you analyze data from both tables together in a PivotTable without merging them into one sheet. Think of it as the Excel equivalent of a database join: you keep your source data separate, and Excel uses the relationship to combine them on demand for reporting.

Why Excel Needs Relationships

Excel is a flat-file tool at heart. For years, if you wanted to summarize data from two tables, you had to copy columns from one into the other using VLOOKUP or INDEX/MATCH, then build a PivotTable from the combined result. That approach works, but it has real drawbacks: it duplicates data, bloats file size, and creates errors when you add new rows and forget to refresh the formulas.

Relationships solve that by letting Excel treat two separate tables as one logical dataset only inside a PivotTable. You define the link once, and every PivotTable you build from either table can pull fields from the other. The underlying tables stay untouched, so there is no duplication and no formula maintenance.

Relationships were introduced in Excel 2013 and are available in all later desktop versions, including Microsoft 365. They work only with PivotTables (and Power Pivot, which is a more advanced add-in). You cannot use a relationship in a regular worksheet formula like SUMIFS; for that you still need XLOOKUP or a similar function.

How Relationships Work Under the Hood

A relationship matches a field in one table (the primary side) to a field in another table (the related side). The primary side must contain unique values—one row per value, like a list of customer IDs with no repeats. The related side can have duplicates, because that is the table with many transactions per customer.

When you build a PivotTable from either table, Excel uses the relationship to fetch matching values from the other table. For example, if you have a Customers table (CustomerID, Name, Region) and an Orders table (OrderID, CustomerID, Amount), a relationship on CustomerID lets you drag Region into a PivotTable that is summarizing Order Amounts. Excel looks up each order’s CustomerID in the Customers table and pulls the region.

Relationships are stored as part of the workbook’s Data Model—a hidden in-memory database that holds the tables you have added. When you create a relationship, Excel adds both tables to the Data Model. You can see the Data Model by opening Power Pivot (if you have it enabled) or by using the Manage Relationships dialog in the Data tab.

How to Create a Relationship in Excel

Creating a relationship is straightforward, but the setup steps matter. Here is the process:

  1. Format both tables as Excel Tables. Select any cell in the data, then press Ctrl+T or go to Insert > Table. Give each table a clear name in the Table Design tab (e.g., Customers and Orders). Relationships require Excel Tables, not plain ranges.
  2. Open the Manage Relationships dialog. Go to the Data tab and click Relationships (in the Data Tools group). If you do not see it, you may need to enable the Power Pivot add-in, though the Data tab button is standard in Excel 2013+.
  3. Click New. In the dialog, choose the primary table from the first dropdown and the related table from the second. Then select the matching columns in each. Excel will often auto-detect the relationship if your column names match—it will show a suggestion in the Create Relationship dialog.
  4. Click OK and then Close. The relationship is now saved.

After that, build a PivotTable from either table (Insert > PivotTable, and check the box “Add this data to the Data Model” if prompted). You will see both tables listed in the PivotTable Fields pane. Drag fields from either table into the PivotTable, and Excel uses the relationship automatically.

Note: menu labels can differ slightly by Excel version and language. In some versions, the button is called Relationships; in others, it is under Data Tools. The steps above match the current Microsoft 365 desktop layout.

Choosing the Right Tables and Keys

The most common mistake is creating a relationship on a column that is not unique on the primary side. Excel will warn you if the primary column has duplicates, but it will not stop you. If you proceed, the PivotTable will return incorrect totals because Excel cannot tell which row to match.

Before you create a relationship, verify that the primary table has one row per value in the key column. Use Remove Duplicates (Data tab) or a quick COUNTIF check. Also ensure the data types match: a numeric ID in one table and a text ID in the other will not match. Convert both to the same type (e.g., change text to number or vice versa) before linking.

You can create multiple relationships in a workbook, but each relationship must connect exactly two tables. If you have three tables (Customers, Orders, Products), you need two relationships: Customers-Orders and Orders-Products. Excel does not support many-to-many relationships directly; you would need a bridge table (a third table that links the two) or use Power Pivot for more complex modeling.

Common Problems and How to Fix Them

Relationships fail in predictable ways. Here are the most frequent issues and their fixes:

  • “The relationship cannot be created because each column contains duplicate values.” This means neither column is unique. You need a unique identifier on at least one side. If you do not have one, create a helper column with a formula like =ROW() to generate unique numbers, or use a different field.
  • PivotTable shows “#N/A” or blank values. This usually means the key columns do not have matching values. Check for leading/trailing spaces, different number formats (e.g., 1 vs 1.00), or text vs. number. Use TRIM and VALUE functions to clean the data.
  • PivotTable fields from the related table are not showing. Make sure both tables are added to the Data Model. When you create a PivotTable, select “Add this data to the Data Model” in the Create PivotTable dialog. If you do not, the relationship may not be active.
  • Totals are wrong (too high or too low). This is often a many-to-many issue. If both tables have duplicate keys, Excel will multiply rows. Re-examine your data model; you may need to aggregate one table first.
  • Relationship disappears when you refresh. This can happen if you rename a table or column after creating the relationship. Always rename tables and columns before linking, or re-create the relationship after changes.

If a relationship is not working, the fastest diagnostic is to create a simple PivotTable with just the key field from both tables. If the counts do not match, the keys are not aligned.

Relationships vs. VLOOKUP vs. Power Pivot

People often confuse relationships with lookup functions and Power Pivot. Here is a clear comparison:

  • VLOOKUP/XLOOKUP: Copies data into your worksheet. Good for one-time reports, but it duplicates data and requires manual refresh if source data changes. Relationships do not copy anything; they reference the original tables live.
  • Relationships: Work only inside PivotTables. They are quick to set up, require no formulas, and keep your data normalized. They are limited to one-to-many links and cannot handle complex calculations beyond what a PivotTable offers.
  • Power Pivot: A full data modeling tool with its own window. It supports many-to-many, DAX measures, calculated columns, and larger datasets (up to millions of rows). Relationships created in Power Pivot are also available to PivotTables, but Power Pivot adds a learning curve and is only in certain Excel editions (Pro Plus, E3, etc.).

For most home or small-business reporting, relationships are the sweet spot: simpler than Power Pivot, more robust than VLOOKUP. If you need calculated fields that do not exist in your source data, or if you have a complex star schema, move to Power Pivot.

Frequently Asked Questions

Can I use a relationship in a regular formula like SUMIFS?

No. Relationships only work inside PivotTables and Power Pivot. For worksheet formulas, you must use lookup functions or combine tables with Power Query. If you need to sum values from a related table based on a condition, use SUMIFS with a lookup helper column, or create a PivotTable and then reference it with GETPIVOTDATA.

Do relationships work on Excel Online or Google Sheets?

Excel Online supports viewing and refreshing PivotTables that use relationships, but creating new relationships is limited. In Google Sheets, there is no direct equivalent; you would use QUERY or VLOOKUP to combine data. For full relationship creation, use the Excel desktop app.

What happens if I delete a table that is part of a relationship?

Excel will break the relationship. If you delete a table that is in the Data Model, the relationship is removed, and any PivotTable that used it will lose access to the related fields. You will need to re-create the relationship with the remaining table or restore the deleted table.

Can I have more than one relationship between the same two tables?

No. Excel allows only one active relationship between any pair of tables. If you need to link them on a different field, you must either create a copy of the table or use Power Pivot, which allows multiple relationships but only one active at a time.

Why is my relationship not showing in the PivotTable Fields pane?

Ensure you added the data to the Data Model when creating the PivotTable. If you did not, the relationship may not be recognized. Also, check that both tables are in the same Data Model—if you created one table as a regular range and the other as a table, they may not be linked. Convert both to Excel Tables first.