Sub topic 13
Compatibility and Comparison with VLOOKUP and INDEX/MATCH
This chapter assumes you can write XLOOKUP with all six arguments, you know exact and approximate match modes, and you are comfortable with absolute references such as $E$2. It covers where XLOOKUP runs, how it differs from the older lookup formulas, and how to choose between them.
Where XLOOKUP is available
XLOOKUP works in Excel for Microsoft 365, Excel 2021 and later, and Excel for the web. It does not exist in Excel 2019, Excel 2016 or earlier. In those versions the formula returns #NAME?.
If a workbook will be opened by people on older versions, XLOOKUP will break for them. Check who uses the file before you rely on it.
The same lookup in three formulas
Suppose A2:A10 holds product IDs, C2:C10 holds prices, and E2 holds the ID to find. These three formulas return the same price.
=XLOOKUP(E2, A2:A10, C2:C10, "Not found")=IFERROR(VLOOKUP(E2, A2:C10, 3, FALSE), "Not found")=IFERROR(INDEX(C2:C10, MATCH(E2, A2:A10, 0)), "Not found")XLOOKUP needs one function. The other two need IFERROR to replace #N/A, and VLOOKUP also needs a column number and a FALSE argument for exact matching.
How the functions differ
| Feature | XLOOKUP | VLOOKUP | INDEX/MATCH |
|---|---|---|---|
| Default match | Exact | Approximate (unless you pass `FALSE`) | Depends on the `MATCH` type argument |
| Return column | A separate return range | A column number counted from the left | A separate return range |
| Lookup column position | Anywhere | Must be the leftmost column | Anywhere |
| Search direction | First to last or last to first | First to last only | First to last only |
| Missing value | Built-in `if_not_found` | Needs `IFERROR` | Needs `IFERROR` |
| Several columns at once | Yes, by spilling | Needs an array of column numbers | Needs extra work |
| Older Excel versions | No | Yes | Yes |
Why the column number in VLOOKUP is fragile
VLOOKUP identifies the return column by its position inside the table. If someone inserts a column inside the table, the position shifts and the formula returns the wrong data without any error. XLOOKUP and INDEX/MATCH refer to the return range itself, so Excel adjusts the reference when columns are inserted.
VLOOKUP also cannot look to the left. To find a price in column C by a code in column D, you would have to rearrange the data. XLOOKUP and INDEX/MATCH handle it directly.
=XLOOKUP(E2, D2:D10, C2:C10, "Not found")Approximate matching differs between functions
VLOOKUP and MATCH approximate matching only finds the next smaller value, and the data must be sorted ascending. XLOOKUP can find the next smaller or the next larger value, and it does not need sorted data unless you choose binary search. This matches the tier examples from earlier chapters.
=XLOOKUP(B2, $E$2:$E$6, $F$2:$F$6, "Below minimum", -1)The rough equivalent in INDEX/MATCH uses match type 1, and it silently returns wrong results on unsorted data.
=INDEX($F$2:$F$6, MATCH(B2, $E$2:$E$6, 1))Decision criteria
Use XLOOKUP when everyone who opens the file has a supported version. It is shorter, safer under column changes, and covers most lookup tasks.
Keep VLOOKUP or INDEX/MATCH when:
- Colleagues or clients use Excel 2019 or earlier.
- You maintain an existing workbook where the formulas already work and nobody is changing the layout.
- You need a two-dimensional return from INDEX with both row and column positions found by
MATCH.
If you are unsure, INDEX/MATCH is the safest choice for compatibility, because it works in every version and has none of VLOOKUP's column-position problems.
Exercise
A colleague on Excel 2016 opens your workbook, and every lookup cell shows #NAME?. Your formula is =XLOOKUP(E2, A2:A10, C2:C10, "Not found"). Rewrite it so it works in Excel 2016 and still returns "Not found" when there is no match.
Show answer
Use =IFERROR(INDEX(C2:C10, MATCH(E2, A2:A10, 0)), "Not found"). MATCH with type 0 finds the exact position, INDEX returns the value at that position in C2:C10, and IFERROR supplies the text when MATCH returns #N/A. =IFERROR(VLOOKUP(E2, A2:C10, 3, FALSE), "Not found") also works because the ID column is leftmost.