A two-way lookup finds a value at the intersection of a row and a column — like pulling the sales figure for a specific month and a specific region out of a grid. The cleanest modern way is to nest one XLOOKUP inside another; the classic way is INDEX with two MATCHes.
H2 meets column label H3:
The example
A small sales grid: months down column A, regions across row 1. We want March / West.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | East | West | South |
| 2 | Jan | $310 | $280 | $190 |
| 3 | Feb | $330 | $300 | $210 |
| 4 | Mar | $360 | $420 | $240 |
| 5 | Apr | $300 | $390 | $260 |
| 6 | May | $345 | $405 | $275 |
The formula
With the lookups in H2 (month) and H3 (region):
How it works
Read it from the inside out:
- The inner
XLOOKUP(H3, B1:D1, B2:D6)finds the region "West" in the header rowB1:D1and returns the entire matching column of numbersB2:B6— the whole West column. - That column becomes the
return_arrayfor the outer XLOOKUP. - The outer
XLOOKUP(H2, A2:A6, …)finds "Mar" in the month list and returns the value from the West column on that row —$420. - Change either input and the intersection updates instantly, in either direction.
Try it: interactive demo
Choose a month and a region; the nested XLOOKUP returns the cell where they cross.
Variations
The classic INDEX / MATCH / MATCH
Works in every version of Excel, including 2019 and older:
Two-way lookup with approximate match
For a rate card where the row or column is a numeric break point, switch the relevant XLOOKUP to match_mode -1 (exact or next smaller).
Pitfalls & errors
#N/A. The label you typed isn’t found exactly — usually a trailing space or a typo. Confirm with =H2=A4; if it returns FALSE, clean the text with TRIM.
Header and data ranges must line up. The inner lookup’s header range (B1:D1) and its return range (B2:D6) must cover the same columns, or you’ll read the wrong column.
INDEX/MATCH needs 0 for exact match. Leaving off the third MATCH argument defaults to approximate match and can return a silently wrong cell on unsorted labels.
Practice workbook
Frequently asked questions
Is nested XLOOKUP better than INDEX/MATCH for a two-way lookup?
Can I do a two-way lookup with VLOOKUP?
Why use two MATCH functions?
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