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.
| XLOOKUP | INDEX MATCH | |
|---|---|---|
| Formula | XLOOKUP(key, lookup_range, return_range) | INDEX(return_range, MATCH(key, lookup_range, 0)) |
| Exact match by default | Yes | Only with MATCH's 0 |
| Not-found value | Fourth argument | Wrap in IFNA |
| Excel | Excel 2021, 2024, Microsoft 365 | Every version |
| Google Sheets | Yes | Yes |
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.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | SKU | Qty | Price | SKU | Product | Price | Stock | ||
| 2 | 2001 | PL-104 | 2 | $34.00 | PL-101 | Fern | $9.50 | 40 | ||
| 3 | 2002 | PT-210 | 1 | $12.50 | PL-104 | Monstera | $34.00 | 12 | ||
| 4 | 2003 | TL-301 | 3 | $18.00 | PL-107 | Snake plant | $22.00 | 25 | ||
| 5 | 2004 | PL-101 | 1 | $9.50 | PT-210 | Terracotta pot | $12.50 | 60 | ||
| 6 | 2005 | SL-401 | 4 | $7.25 | PT-212 | Ceramic pot | $19.00 | 18 | ||
| 7 | 2006 | PL-104 | 1 | $34.00 | TL-301 | Watering can | $18.00 | 9 | ||
| 8 | 2007 | PT-212 | 2 | $19.00 | SL-401 | Potting mix | $7.25 | 80 | ||
| 9 | 2008 | PL-107 | 1 | $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.
| G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|
| 1 | SKU | Product | Price | Stock | Product | Monstera | |
| 2 | PL-101 | Fern | $9.50 | 40 | SKU | PL-104 | |
| 3 | PL-104 | Monstera | $34.00 | 12 | |||
| 4 | PL-107 | Snake plant | $22.00 | 25 | |||
| 5 | PT-210 | Terracotta pot | $12.50 | 60 | |||
| 6 | PT-212 | Ceramic pot | $19.00 | 18 | |||
| 7 | TL-301 | Watering can | $18.00 | 9 | |||
| 8 | SL-401 | Potting mix | $7.25 | 80 |
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
| A | B | C | D | E | F | G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | SKU | Qty | SKU | Product | Price | Stock | Product | Fern | ||||
| 2 | 2001 | PL-104 | 2 | PL-101 | Fern | $9.50 | 40 | SKU | |||||
| 3 | 2002 | PT-210 | 1 | PL-104 | Monstera | $34.00 | 12 | ||||||
| 4 | 2003 | TL-301 | 3 | PL-107 | Snake plant | $22.00 | 25 | ||||||
| 5 | 2004 | PL-101 | 1 | PT-210 | Terracotta pot | $12.50 | 60 | ||||||
| 6 | 2005 | SL-401 | 4 | PT-212 | Ceramic pot | $19.00 | 18 | ||||||
| 7 | 2006 | PL-104 | 1 | TL-301 | Watering can | $18.00 | 9 | ||||||
| 8 | 2007 | PT-212 | 2 | SL-401 | Potting mix | $7.25 | 80 | ||||||
| 9 | 2008 | PL-107 | 1 |
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.
Sources
Official documentation the facts on this page were checked against.