
The XLOOKUP function in Excel finds a value in one column and returns the matching value from any other column, to the left or right. It replaces most VLOOKUP and INDEX MATCH formulas with something easier to read. This guide shows XLOOKUP examples with made-up data: an exact match, a custom not found message, several columns at once, an approximate match and a search from the bottom.
XLOOKUP is available in Excel for Microsoft 365 and Excel 2021 or later. It is not in Excel 2019 or older.
XLOOKUP syntax
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
The first three arguments are required. The other three are optional.

Basic exact match
Say A2:A6 holds product codes and C2:C6 holds prices. To get the price for the code in F1:
=XLOOKUP(F1, A2:A6, C2:C6)
XLOOKUP does an exact match by default, so you do not need a FALSE at the end like in VLOOKUP.
Look up to the left
The return column can sit on either side of the lookup column. To get the code from a product name in column B:
=XLOOKUP(F1, B2:B6, A2:A6)
VLOOKUP cannot do this without a workaround.

Show a message when nothing is found
The fourth argument replaces the #N/A error:
=XLOOKUP(F1, A2:A6, C2:C6, "Not found")
This is cleaner than wrapping the formula in IFERROR, and it only replaces the not found case, so other errors still show.
Return several columns at once
If the return array has more than one column, the result spills across. To get the name and the price together:
=XLOOKUP(F1, A2:A6, B2:C6)
Keep the cells to the right empty so the result has room.

Approximate match for tiers
The match mode argument controls how close the match must be:
- 0 is an exact match (the default).
- -1 is an exact match, or the next smaller value.
- 1 is an exact match, or the next larger value.
- 2 is a wildcard match.
For a discount table where column A holds the minimum order and column B the discount, use -1 to get the tier a number falls into:
=XLOOKUP(F1, A2:A5, B2:B5, "No tier", -1)
The lookup column does not need to be sorted for this to work.
Wildcard match
With match mode 2, an asterisk stands for any characters. To find a product that contains "desk":
=XLOOKUP("*desk*", B2:B6, C2:C6, "Not found", 2)

Find the last match
If a value appears more than once, XLOOKUP returns the first one by default. The search mode argument can reverse that. Use -1 to search from the bottom and get the most recent entry:
=XLOOKUP(F1, A2:A100, C2:C100, "Not found", 0, -1)
Look up with two criteria
To match two columns at once, multiply two tests inside the lookup array:
=XLOOKUP(1, (A2:A6=F1)*(B2:B6=G1), C2:C6, "Not found")
The same idea with INDEX and MATCH is explained in our guide to the INDEX MATCH formula in Excel.
XLOOKUP or VLOOKUP?
XLOOKUP needs no column number, so it does not break when you insert a column. For a side by side comparison read XLOOKUP vs VLOOKUP. If your VLOOKUP returns errors, see how to fix VLOOKUP #N/A.
Common XLOOKUP mistakes
- Arrays of different size. The lookup and return arrays must have the same number of rows.
- Spill blocked. A #SPILL! error means something sits in the way of a multi-column result.
- Numbers stored as text. A number and a text number do not match. Convert one of them.
- Older Excel. In Excel 2019 or earlier the function name is not recognized.
Questions and answers
Does XLOOKUP work in Google Sheets?
Yes. Google Sheets has an XLOOKUP function with the same core arguments.
Is XLOOKUP case sensitive?
No. For a case sensitive lookup, combine INDEX with MATCH and EXACT.
Can XLOOKUP look across rows?
Yes. Pass a row for the lookup array and a row for the return array, and it works the same way as a column lookup.
Can I use XLOOKUP across sheets?
Yes. Reference the range on the other sheet, for example Prices!A2:A100.
Summary
Use XLOOKUP with three arguments for an exact match, add the fourth for a clean not found message, and use match and search modes for tiers and the latest entry.
