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)
P101Widget12
P102Gadget28
P103Cable9
P104Hub45
P105Dock60

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

NeedXLOOKUPINDEX/MATCH
Exact matchDefaultMATCH(..., 0)
Look left (name → SKU)NaturalSame idea, swap ranges
Friendly no-match text4th arg if_not_foundWrap with IFNA / IFERROR
Two-way (row + column headers)Nested XLOOKUP or INDEX still fineClassic INDEX(..., MATCH row, MATCH col)
Excel 2019 / older shared filesMay not existWorks
Interview says “use INDEX MATCH”Mention XLOOKUP afterWrite this first

Worked problems (with answers)

Use the table above. Put answers in column F unless noted.

Exact match

  1. 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

  1. 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

  1. Missing SKU P999 should show Not 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.

  1. 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

  1. Keys in E2:E4 = P101, P105, P102. Prices in F2: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:

EastWestNorth
Widget101411
Gadget201822
  1. 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).

  1. 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

Clean keys first if #N/A persists: text cleanup before lookups.

Decision rule

  1. Your machine / Microsoft 365 → XLOOKUP for 1D lookups.
  2. Shared legacy workbook or “show INDEX MATCH” → INDEX/MATCH with exact 0.
  3. Two-way matrix → INDEX + dual MATCH (or nested XLOOKUP if allowed).
  4. Still on VLOOKUP only → graduate via VLOOKUP vs XLOOKUP, then this page.

Practice next

Excel practice hub · Free lessons · Blog