Find the value at the intersection of a row and a column — sales for “East” in “Q2.” Nest one XLOOKUP inside another: the inner one picks the column, the outer one picks the row.
The example
Sales for East / Q2 from a grid.
| A | B | C | |
|---|---|---|---|
| 1 | Region\Q | Q1 | Q2 |
| 2 | East | 20,000 | 22,000 |
The formula
Nest column lookup inside row lookup:
How it works
Two lookups compose into an intersection:
- The inner
XLOOKUP(colKey, colLabels, grid)returns the whole column for that key. - The outer
XLOOKUP(rowKey, rowLabels, thatColumn)picks the row from it. - The result is the single cell where the chosen row and column meet.
- It reads naturally and, unlike INDEX/MATCH/MATCH, needs no separate row/column index arithmetic.
Classic equivalent: =INDEX(grid, MATCH(rowKey, rows, 0), MATCH(colKey, cols, 0)) does the same in any version. The nested-XLOOKUP form is the modern, more readable take.
Try it: interactive demo
Pick region and quarter.
Variations
INDEX/MATCH version
Any version:
With not-found
Default on the outer:
SUMIFS alternative
If keys are columns of data:
Pitfalls & errors
Grid must align with labels. The inner lookup’s return grid and the column labels must span the same columns; likewise rows for the outer.
Exact keys. Both keys match exactly — watch for trailing spaces or case differences in labels.
365/2021 only. Use INDEX/MATCH/MATCH otherwise.
Practice workbook
Frequently asked questions
How do I do a two-way lookup with XLOOKUP?
What's the INDEX/MATCH equivalent?
Can I use SUMIFS instead?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class