The short answer
- Use XLOOKUP if everyone who opens the file has Microsoft 365, Excel 2021 or later, or Google Sheets. It’s the simplest and safest.
- Use INDEX/MATCH if the file must work in Excel 2019 or older. It’s flexible and doesn’t break when columns move.
- Use VLOOKUP only for quick, simple lookups in older files — and always with
FALSEas the last argument.
The example
All the formulas below look up a product code from cell A2 on a sheet called Products, where codes are in column A, names in column B and prices in column C.
| Row | A | B | C |
|---|---|---|---|
| 1 | Code | Product | Price |
| 2 | SKU-101 | Laptop Stand Pro | 49.00 |
| 3 | SKU-102 | Wireless Keyboard | 39.00 |
| 4 | SKU-103 | USB-C Dock | 129.00 |
VLOOKUP
=VLOOKUP(A2, Products!A:C, 3, FALSE)VLOOKUP searches the first column of the range (Products!A:C) for the code and returns the value from the 3rd column of that range. The last argument, FALSE, means exact match.
Its weaknesses:
- It defaults to approximate match. Leave out
FALSEand VLOOKUP may return a value from the wrong row without any error. - It can only look right. The code must be in the first column of the range, so you can’t return a value from a column to its left.
- The column number is hard-coded. Insert a column between A and C and
3now points at the wrong data.
INDEX/MATCH
=INDEX(Products!C:C, MATCH(A2, Products!A:A, 0))MATCH finds the row where the code appears (the 0 means exact match), and INDEX returns the value in that row of the price column. Because the return column is referenced directly, inserting columns doesn’t break it, and the return column can be anywhere — including to the left of the lookup column.
It works in every version of Excel and in Google Sheets. The downside is readability: two nested functions, and MATCH also defaults to approximate matching if you leave out the 0.
XLOOKUP
=XLOOKUP(A2, Products!A:A, Products!C:C, "Not found")XLOOKUP takes the value to find, the column to search and the column to return. It matches exactly by default, the fourth argument says what to show when nothing is found, and it can return several columns at once:
=XLOOKUP(A2, Products!A:A, Products!B:C)That returns both the product name and the price, spilling into two cells. XLOOKUP can also search from the bottom up — useful for “the most recent order for this customer” — with a sixth argument of -1.
Side-by-side comparison
| Feature | VLOOKUP | INDEX/MATCH | XLOOKUP |
|---|---|---|---|
| Works in Excel 2019 and older | Yes | Yes | No |
| Works in Google Sheets | Yes | Yes | Yes |
| Default match type | Approximate | Approximate (MATCH) | Exact |
| Look to the left | No | Yes | Yes |
| Survives inserted columns | No | Yes | Yes |
| Built-in “not found” value | No | No | Yes |
| Return several columns at once | No | No | Yes |
| Search from the last match | No | No | Yes |
Two-way lookups
To find the value where a row label and a column header meet — say the price for product A2 in the month named in B1 — combine INDEX with two MATCH functions:
=INDEX(Prices!B2:M100, MATCH(A2, Prices!A2:A100, 0), MATCH(B1, Prices!B1:M1, 0))Or nest two XLOOKUPs:
=XLOOKUP(A2, Prices!A2:A100, XLOOKUP(B1, Prices!B1:M1, Prices!B2:M100))Lookups with two conditions
To find a price where both the product (F2) and the region (G2) match, multiply the two conditions so only rows where both are true equal 1, then look up 1:
=XLOOKUP(1, (Sales!A2:A500=F2) * (Sales!B2:B500=G2), Sales!C2:C500, "Not found")In Excel 2019 and older, use INDEX/MATCH with the same idea and confirm the formula with Ctrl+Shift+Enter:
=INDEX(Sales!C2:C500, MATCH(1, (Sales!A2:A500=F2) * (Sales!B2:B500=G2), 0))Common lookup mistakes
- Forgetting exact match —
FALSEin VLOOKUP,0in MATCH. - Relative ranges that move when copied.
A2:C100becomesA3:C101in the next row. Use whole columns (A:C), absolute references ($A$2:$C$100) or an Excel table. - Numbers stored as text on one side of the lookup, which makes matching values fail with
#N/A. See how to convert text to numbers. - Trailing spaces in either the lookup value or the lookup column. Wrap the lookup value in
TRIM, and clean the column. - Hiding real problems with IFERROR. Prefer XLOOKUP’s fourth argument or
IFNA, which only catch “not found”. Our guide to Excel formula errors explains why.
Frequently asked questions
Is XLOOKUP better than VLOOKUP?
For most jobs, yes. XLOOKUP defaults to an exact match, can look to the left, doesn't break when columns are inserted and has a built-in "not found" result. Use VLOOKUP or INDEX/MATCH only when the file must work in Excel 2019 or older.
Which Excel versions have XLOOKUP?
Microsoft 365, Excel 2021 and later, and Excel for the web. Google Sheets added XLOOKUP in 2022. Excel 2019, 2016 and earlier don't have it and show #NAME?.
Why does VLOOKUP return the wrong value?
Usually because the last argument was left out, so VLOOKUP did an approximate match on unsorted data. Always end an exact lookup with FALSE.
How do I look up a value based on two conditions?
In Excel 365 use =XLOOKUP(1, (A2:A100=F2)*(B2:B100=G2), C2:C100). In older Excel, use the same idea with INDEX and MATCH, entered with Ctrl+Shift+Enter.