VLOOKUP vs XLOOKUP: which should you use?
Short answer
Use XLOOKUP if everyone who opens the file has Excel 365 or Excel 2021 or later: it can look left, matches exactly by default and has a built-in "not found" value. Use VLOOKUP (or INDEX-MATCH) when the file must work in older Excel versions.
On this page
Side by side
| VLOOKUP | XLOOKUP | |
|---|---|---|
| Available in | Every Excel version | Excel 365, Excel 2021 and later |
| Default match | Approximate (if the last argument is left out) | Exact |
| Look to the left | No | Yes |
| Column inserted in the table | Can return the wrong column | Still correct |
| Value not found | #N/A (wrap in IFERROR) | Built-in if_not_found argument |
| Search from the bottom | No | Yes (search_mode -1) |
Same lookup, both ways
Find the price of product code in A2 from a table in Products!A:C (code, name, price):
=VLOOKUP(A2, Products!A:C, 3, FALSE)
=XLOOKUP(A2, Products!A:A, Products!C:C, "Not found")
Looking left
To find the code from a product name in column B, VLOOKUP cannot help because the answer is to the left. XLOOKUP can:
=XLOOKUP("Notebook", Products!B:B, Products!A:A)
The INDEX-MATCH alternative
Works in every version, can look left, and is what many experienced analysts still use:
=INDEX(Products!C:C, MATCH(A2, Products!A:A, 0))
The classic VLOOKUP mistake
Leaving out the last argument makes VLOOKUP use approximate match, which can return a wrong value silently on unsorted data. Always write FALSE (or 0) for exact match.
Try it yourself
5 questions from the LogicByte practice bank. Pick an answer to check it.
-
1Why should SUMIFS ranges generally have matching dimensions?