VLOOKUP vs XLOOKUP vs INDEX MATCH: Which One Should You Use?
· 3 min read
Short answer: use XLOOKUP if everyone who opens the file has Excel 2021, Microsoft 365 or Google Sheets. Use INDEX MATCH if the file must also work in Excel 2019 or older. Use VLOOKUP only for quick one-off lookups, or when you are maintaining a workbook that already uses it.
All three do the same basic job: find a value in one column and return the value from the same row in another column. They differ in what happens when your data is less tidy than the textbook example.
The same lookup, written three ways
Product IDs are in column D, prices in column F, and the ID you are looking for is in A2.
=VLOOKUP(A2,$D$2:$F$100,3,FALSE)
=XLOOKUP(A2,$D$2:$D$100,$F$2:$F$100)
=INDEX($F$2:$F$100,MATCH(A2,$D$2:$D$100,0))
How they compare
| VLOOKUP | XLOOKUP | INDEX MATCH | |
|---|---|---|---|
| Works in | Every version | Excel 2021, Microsoft 365, Google Sheets | Every version |
| Can look to the left | No | Yes | Yes |
| Survives inserted columns | No | Yes | Yes |
| Default match type | Approximate | Exact | Approximate, unless you add 0 |
| Built-in "not found" value | No | Yes | No |
| Can search from the bottom up | No | Yes | No |
Where VLOOKUP breaks
VLOOKUP has three weaknesses that cause most lookup bugs.
It only looks to the right. The lookup column must be the first column of the range. If the ID is in column F and the price in column D, VLOOKUP cannot do it without rearranging the data.
The column number is hard-coded. The 3 in the formula means "the third column of the range". Insert a column between D and F and the formula silently returns the wrong column. Ask for a column beyond the range and you get #REF!.
The default is approximate match. Leave out the fourth argument and VLOOKUP assumes the data is sorted and returns the nearest smaller value. On unsorted data that is a wrong answer with no error to warn you. Always write FALSE unless you really want a range lookup, such as tax brackets.
What XLOOKUP fixes
XLOOKUP takes the lookup column and the return column as two separate ranges, so direction does not matter and inserted columns cannot shift the result. It matches exactly by default, and it has a fourth argument for what to show when nothing is found:
=XLOOKUP(A2,$D$2:$D$100,$F$2:$F$100,"Not found")
It can also search from the last row upwards by setting the sixth argument to -1, which is the easy way to get the most recent entry for a customer or product.
The one real drawback is compatibility. Open a workbook with XLOOKUP in Excel 2016 or 2019 and every one of those cells shows #NAME?.
When INDEX MATCH is still the right choice
INDEX MATCH is two functions working together: MATCH finds the row number, INDEX returns the value at that row. It works in every version of Excel and in Google Sheets, looks in any direction, and is not affected by inserted columns.
It is also the natural tool for a two-way lookup, where you match both a row and a column:
=INDEX($B$2:$M$50,MATCH(A2,$A$2:$A$50,0),MATCH(B1,$B$1:$M$1,0))
The cost is readability. Two nested functions are harder to read than one, and forgetting the final 0 in MATCH brings back the approximate-match problem.
How to choose
- Everyone is on Microsoft 365, Excel 2021 or Google Sheets: XLOOKUP.
- The file is shared with people on older Excel: INDEX MATCH.
- A quick lookup in a sheet only you use, with the key in the first column: VLOOKUP is fine. Add
FALSE. - You need to match on two conditions: see VLOOKUP with multiple criteria.
Whichever you pick, most failed lookups come from the data rather than the function: trailing spaces and numbers stored as text. If a lookup returns an error for a value you can see in the table, start with the checklist for the #N/A error.