Create Excel for Mac Table Relationships with XLOOKUP or Power Query
Question details
The user needs to connect a department key table with an employee table and show department names in a PivotTable on Excel for Mac.
- Product
- Microsoft Excel for Mac
- Device & OS
- Mac
- Scenario
- An employee table contains department numbers, while a separate department key table contains department numbers and names. The user wants to combine these fields for PivotTable reporting.
- Observed behavior
- The Data Model relationship feature may be unavailable or limited depending on the Excel for Mac build and license, so the tables cannot always be related directly.
Confirm that both source ranges are formatted as Excel tables and that the department key and employee columns use matching values and data types. Note the exact table names and column names before entering a structured-reference formula.
Add department names with XLOOKUP before creating the PivotTable
Use this approach when Excel for Mac does not provide usable Data Model relationships or when you need a simple, reliable result.
A lookup column copies the department name from the key table into each employee row. The resulting Employee table can then serve as the source for a standard PivotTable.
Select the department key range and choose Insert > Table. Name it DepartmentKeys in Table Design. Ensure it has Number and Department columns. Format the employee range as a table and name it Employee.
In the Employee table, add a column named DepartmentName. In the first cell under that heading, enter =XLOOKUP([@Department],DepartmentKeys[Number],DepartmentKeys[Department],"Unknown") and press Return.
Select any cell in the Employee table, choose Insert > PivotTable, and place DepartmentName in Rows or Filters and the required employee field in Values.
Merge the tables with Power Query
Use Power Query when you want a repeatable data-preparation process or need to combine more than one field before reporting.
Create a Data Model relationship when the feature is available
Use this option only when your Excel for Mac build and license support adding tables to the Data Model and creating relationships.
Use WPS Spreadsheet for Lookup-Based PivotTable Reports
WPS Spreadsheet provides a free, lightweight way to open Excel workbooks, add lookup formulas, prepare related data in one table, and create PivotTables with a familiar interface. It supports smooth migration for common Excel reporting workflows while preserving widely used Office formats.
- 1. Open the workbook: Launch WPS Spreadsheet and choose Menu > Open to load the existing XLSX workbook.
- 2. Add the lookup result: In the employee table, add a DepartmentName column and use a lookup formula that matches the department number to the department key table.
- 3. Create the report: Select the completed employee table, choose Insert > PivotTable, and place DepartmentName in the row area to display department names.

Frequently Asked Questions
Why can’t I create a relationship between tables in Excel for Mac?
Data Model and relationship support varies by Excel for Mac build and license. If the relationship or Power Pivot commands are unavailable, add a DepartmentName column with XLOOKUP or merge the tables through Data > Get Data.
What formula connects the employee department number to the department name?
If the tables are named Employee and DepartmentKeys, enter =XLOOKUP([@Department],DepartmentKeys[Number],DepartmentKeys[Department],"Unknown") in a DepartmentName column in the Employee table.
Which columns should be used to merge the tables in Power Query?
Select Employee[Department] and DepartmentKeys[Number] as the matching columns. Use a Left Outer join so every employee remains in the result, even when a department number has no matching key.
How do I show department names in the final PivotTable?
After using XLOOKUP or loading the merged Power Query result, select the completed table and choose Insert > PivotTable. Add DepartmentName to Rows or Filters and the employee measure to Values.




