XLOOKUP vs INDEX MATCH — which should you use?
Side-by-side XLOOKUP and INDEX/MATCH on the same catalog—exact match, look left, two-way lookup, and when INDEX/MATCH still wins for older Excel.
Both XLOOKUP and INDEX/MATCH can return a value from another column (or row) based on a key. On Microsoft 365, default to XLOOKUP. Keep INDEX/MATCH when the file must open in Excel 2019 or earlier, or when an interviewer asks for it by name.
Practice the patterns live: XLOOKUP lesson · INDEX MATCH lesson · worksheets: catalog XLOOKUP · related: VLOOKUP vs XLOOKUP.
Same task, two formulas
Product table in A2:C6 (SKU, Product, Price). Lookup SKU in E2. Return Product in F2.
| A (SKU) | B (Product) | C (Price) |
|---|---|---|
| P101 | Widget | 12 |
| P102 | Gadget | 28 |
| P103 | Cable | 9 |
| P104 | Hub | 45 |
| P105 | Dock | 60 |
XLOOKUP
=XLOOKUP(E2, $A$2:$A$6, $B$2:$B$6, "Not found")
INDEX/MATCH
=INDEX($B$2:$B$6, MATCH(E2, $A$2:$A$6, 0))
With E2 = P102, both return Gadget.
Side-by-side cheat sheet
| Need | XLOOKUP | INDEX/MATCH |
|---|---|---|
| Exact match | Default | MATCH(..., 0) |
| Look left (name → SKU) | Natural | Same idea, swap ranges |
| Friendly no-match text | 4th arg if_not_found | Wrap with IFNA / IFERROR |
| Two-way (row + column headers) | Nested XLOOKUP or INDEX still fine | Classic INDEX(..., MATCH row, MATCH col) |
| Excel 2019 / older shared files | May not exist | Works |
| Interview says “use INDEX MATCH” | Mention XLOOKUP after | Write this first |
Worked problems (with answers)
Use the table above. Put answers in column F unless noted.
Exact match
- Return Product for SKU
P104.
XLOOKUP: =XLOOKUP("P104",$A$2:$A$6,$B$2:$B$6) → Hub INDEX/MATCH: =INDEX($B$2:$B$6,MATCH("P104",$A$2:$A$6,0)) → Hub
- Return Price for SKU in
E2(P101).
XLOOKUP: =XLOOKUP(E2,$A$2:$A$6,$C$2:$C$6) → 12 INDEX/MATCH: =INDEX($C$2:$C$6,MATCH(E2,$A$2:$A$6,0)) → 12
- Missing SKU
P999should showNot found.
XLOOKUP: =XLOOKUP("P999",$A$2:$A$6,$B$2:$B$6,"Not found") → Not found INDEX/MATCH: =IFNA(INDEX($B$2:$B$6,MATCH("P999",$A$2:$A$6,0)),"Not found") → Not found
Look left
Product name in E2 = Cable. Return SKU in F2.
- XLOOKUP:
=XLOOKUP(E2,$B$2:$B$6,$A$2:$A$6)→P103
INDEX/MATCH: =INDEX($A$2:$A$6,MATCH(E2,$B$2:$B$6,0)) → P103
VLOOKUP cannot do this without rearranging columns. That is why XLOOKUP / INDEX MATCH beat classic VLOOKUP for flexible layouts. See VLOOKUP practice.
Fill-down safely
- Keys in
E2:E4=P101,P105,P102. Prices inF2:F4.
XLOOKUP in F2 filled down: =XLOOKUP(E2,$A$2:$A$6,$C$2:$C$6) INDEX/MATCH: =INDEX($C$2:$C$6,MATCH(E2,$A$2:$A$6,0)) Lock the table with $ so the lookup range does not slide. Related: absolute references.
Two-way INDEX (where MATCH still shines)
Matrix in A1:D4:
| East | West | North | |
|---|---|---|---|
| Widget | 10 | 14 | 11 |
| Gadget | 20 | 18 | 22 |
- Return West / Gadget.
=INDEX($B$2:$D$3, MATCH("Gadget",$A$2:$A$3,0), MATCH("West",$B$1:$D$1,0)) → 18
You *can* nest XLOOKUP for the same idea; many interviewers still expect the INDEX + two MATCHes form. Drill: INDEX MATCH practice exercises.
Approximate / next-smaller (grades)
Thresholds in A2:B5: Score cutoffs 0,60,80,90 → grades F,C,B,A (sorted ascending).
- Score
85→ grade.
XLOOKUP: =XLOOKUP(85,$A$2:$A$5,$B$2:$B$5,,-1) → B INDEX/MATCH: =INDEX($B$2:$B$5,MATCH(85,$A$2:$A$5,1)) → B (match_mode -1 / MATCH type 1 = next smaller on a sorted list—never on unsorted SKUs.)
Common mistakes
- Forgetting
0inMATCH→ approximate match on IDs → silent wrong rows. - Leaving table ranges relative on fill-down →
#N/Aor wrong hits. - Blanketing
IFERRORaround INDEX/MATCH so real formula bugs look like “Not found.” PreferIFNA. - Assuming XLOOKUP exists on every office PC—ask about Excel version before rewriting a shared model.
Clean keys first if #N/A persists: text cleanup before lookups.
Decision rule
- Your machine / Microsoft 365 → XLOOKUP for 1D lookups.
- Shared legacy workbook or “show INDEX MATCH” → INDEX/MATCH with exact
0. - Two-way matrix → INDEX + dual MATCH (or nested XLOOKUP if allowed).
- Still on VLOOKUP only → graduate via VLOOKUP vs XLOOKUP, then this page.
Practice next
- Live drills: XLOOKUP · INDEX MATCH
- Exercise sets: XLOOKUP exercises · INDEX MATCH exercises
- Desktop files: Free worksheets (catalog XLOOKUP pack)
- Put lookups in a full screen-share: Excel interview case study
- Date KPIs next: SUMIFS with dates
- New here? Beginners path · Placement test · Practice hub