formulastreak

XLOOKUP vs INDEX MATCH

Updated · Works in: Excel 2021+, Microsoft 365, Google Sheets · Every example checked before release

Short answer

XLOOKUP(key, lookup_range, return_range) if everyone has Excel 2021 or later, Microsoft 365 or Google Sheets; INDEX(return_range, MATCH(key, lookup_range, 0)) for any version. Both look left and survive inserted columns.

Use XLOOKUP if everyone who opens the file has Excel 2021 or later, Microsoft 365 or Google Sheets; use INDEX MATCH when someone might have an older Excel. Both look left as easily as right and survive inserted columns. XLOOKUP is one function with a built-in “not found” value; INDEX MATCH is two functions that work in every version.

XLOOKUPINDEX MATCH
FormulaXLOOKUP(key, lookup_range, return_range)INDEX(return_range, MATCH(key, lookup_range, 0))
Exact match by defaultYesOnly with MATCH's 0
Not-found valueFourth argumentWrap in IFNA
ExcelExcel 2021, 2024, Microsoft 365Every version
Google SheetsYesYes

The same lookup, two ways

The price of each ordered SKU. XLOOKUP: XLOOKUP(B2, $G$2:$G$8, $I$2:$I$8). INDEX MATCH: INDEX($I$2:$I$8, MATCH(B2, $G$2:$G$8, 0)), where MATCH finds the row and INDEX returns the price from it. Same results, $34.00 for the first order.

Orders and price list · edit D2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultD2 = $34.00
ABCDEFGHIJ
1OrderSKUQtyPriceSKUProductPriceStock
22001PL-1042$34.00PL-101Fern$9.5040
32002PT-2101$12.50PL-104Monstera$34.0012
42003TL-3013$18.00PL-107Snake plant$22.0025
52004PL-1011$9.50PT-210Terracotta pot$12.5060
62005SL-4014$7.25PT-212Ceramic pot$19.0018
72006PL-1041$34.00TL-301Watering can$18.009
82007PT-2122$19.00SL-401Potting mix$7.2580
92008PL-1071$22.00

Looking left

Find a SKU from a product name, where the SKU column is to the left. Both can: XLOOKUP(M1, H2:H8, G2:G8) and INDEX(G2:G8, MATCH(M1, H2:H8, 0)). VLOOKUP can't, because it only returns columns to the right of the search column.

Orders and price list · edit M2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultM2 = PL-104
GHIJKLM
1SKUProductPriceStockProductMonstera
2PL-101Fern$9.5040SKUPL-104
3PL-104Monstera$34.0012
4PL-107Snake plant$22.0025
5PT-210Terracotta pot$12.5060
6PT-212Ceramic pot$19.0018
7TL-301Watering can$18.009
8SL-401Potting mix$7.2580

Where each one wins

XLOOKUP is shorter, defaults to an exact match, has an if_not_found argument, can search from the bottom (search mode -1) and can return several columns at once. INDEX MATCH works in Excel 2019 and older, and its parts are useful on their own: MATCH for a position, INDEX with two MATCHes for a two-way lookup. Both need the lookup and return ranges on the same rows. If either returns #N/A for a value you can see, check for spaces and text-numbers.

Which should a beginner learn first?

XLOOKUP, if you have it: one function, fewer ways to go wrong. Learn INDEX MATCH next, because you'll meet it in shared files, older versions and job tests, and because MATCH on its own is worth knowing. The INDEX MATCH guide builds it up one function at a time.

Check yourself

One real exercise from the “Lookups” unit. Checked on our server; no account needed.

Look left with XLOOKUP: find the SKU (G2:G8) for the product named in M1 by searching the products (H2:H8). Answer in M2.

  • Use XLOOKUP
Select M2 and type = to start its formula (in the cell or the formula bar)
ABCDEFGHIJKLM
1OrderSKUQtySKUProductPriceStockProductFern
22001PL-1042PL-101Fern$9.5040SKU
32002PT-2101PL-104Monstera$34.0012
42003TL-3013PL-107Snake plant$22.0025
52004PL-1011PT-210Terracotta pot$12.5060
62005SL-4014PT-212Ceramic pot$19.0018
72006PL-1041TL-301Watering can$18.009
82007PT-2122SL-401Potting mix$7.2580
92008PL-1071

Common mistakes

  • Leaving out MATCH's 0, so INDEX MATCH does an approximate match on unsorted data.

  • Lookup and return ranges that start on different rows, so the result comes from the wrong row.

  • Using XLOOKUP in a file someone will open in Excel 2019 or older, where it shows #NAME?.

Questions

Can INDEX MATCH use several criteria?+

Yes: INDEX(result, MATCH(1, (A=x)*(B=y), 0)). XLOOKUP does the same with XLOOKUP(1, (A=x)*(B=y), result).

Reading is step one. Now make it stick.

Practise it in a five-minute lesson on a live sheet, with instant feedback. No account needed for the free units.

Practise XLOOKUP in the course

Sources

Official documentation the facts on this page were checked against.