XLOOKUP vs VLOOKUP: what's the difference and which should you use?
Use XLOOKUP if your Excel has it. It matches exactly by default, can look left, handles missing values on its own, and doesn't break when someone inserts a column. You still need to know VLOOKUP, because older files, older Excel versions and many job interviews use it.
Quick comparison
| VLOOKUP | XLOOKUP | |
|---|---|---|
| Default match | Approximate, unless the last argument is FALSE | Exact |
| Return a column to the left | No | Yes |
| Value not found | #N/A, so you wrap it in IFERROR or IFNA | Built-in "if not found" argument |
| Someone inserts a column | The column number can point to the wrong column | Keeps working, because you select the return range |
| Search from the bottom up | No | Yes (search mode -1) |
| Available in | Every Excel version and Google Sheets | Excel for Microsoft 365, Excel 2021 and later, Excel for the web, Google Sheets |
How do you write the same lookup with both?
The orders table has a product code in B2, and the price list is in E2:G7, with codes in column E and prices in column G.
=VLOOKUP(B2,E2:G7,3,FALSE)
=XLOOKUP(B2,E2:E7,G2:G7)
VLOOKUP needs the whole table and a column number (3 = the third column of E:G). XLOOKUP needs only the column to search and the column to return.
Why does VLOOKUP sometimes return a wrong value with no error?
Because its default is approximate match. If you leave out the last argument, VLOOKUP assumes the first column is sorted and may return the nearest smaller value instead of #N/A. For exact matches, always end VLOOKUP with FALSE (or 0). XLOOKUP is exact unless you ask otherwise.
Can VLOOKUP look to the left?
No. VLOOKUP can only return columns to the right of the column it searches. To find a code from a product name in a column further right, use XLOOKUP, or INDEX with MATCH in older Excel:
=INDEX(E2:E7,MATCH(H2,G2:G7,0))
How do you handle values that aren't found?
XLOOKUP has a fourth argument for this:
=XLOOKUP(B2,E2:E7,G2:G7,"Not found")
With VLOOKUP you wrap the formula:
=IFNA(VLOOKUP(B2,E2:G7,3,FALSE),"Not found")
Common mistake: wrapping everything in IFERROR. It also hides real mistakes, such as a typo in the range, so prefer IFNA when you only expect missing values.
When should you still use VLOOKUP?
When the file must work in Excel 2019 or older, when you edit someone else's workbook built on VLOOKUP, and in interviews and tests that ask for it by name. Interviewers also like the follow-up question: why can't VLOOKUP return a column to the left? Now you know.
Practise VLOOKUP Practise XLOOKUP