
Look up a value in one range and return a corresponding value from another range. XLOOKUP is a flexible modern replacement for many VLOOKUP, HLOOKUP, and INDEX/MATCH patterns.
The Excel XLOOKUP function searches one range for a match and returns a corresponding value from another range. It is more flexible than VLOOKUP and HLOOKUP because the lookup range and return range are separate, so the return value does not have to be on one particular side of the table.
XLOOKUP is often used as a modern replacement for older lookup formulas. It supports exact match by default, has built-in handling for missing results, can search from the bottom of a list, and can return multiple columns at once.
Because of that flexibility, XLOOKUP is useful in both simple lookups and more advanced models where table structure may change over time.
Finds a match in one range and returns a related value or record from another range.
Returns the matched value, a spilled record, or a custom if_not_found result.
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
lookup_value is the item to find, lookup_array is where Excel searches for it, and return_array is what Excel returns when it finds a match. The remaining arguments let you control missing matches, match behavior, and search direction.
XLOOKUP uses exact match by default, which is one of the main differences from older lookup functions that often rely on approximate match unless you specify otherwise.
The lookup array and return array should line up in size. If one has more rows or columns than the other, the result will not behave as intended.
XLOOKUP overlaps with several older lookup functions, but its main advantage is flexibility.
| Function | Main Strength | Use When |
|---|---|---|
XLOOKUP |
Flexible lookup and return ranges | You want a modern lookup function that can work in any direction |
VLOOKUP |
Classic vertical lookup | The workbook already uses a leftmost lookup table layout |
HLOOKUP |
Classic horizontal lookup | The lookup keys are stored across the top row |
INDEX + MATCH |
Flexible lookup with separate position logic | You need similar flexibility in workbooks that do not use XLOOKUP |
In many modern workbooks, XLOOKUP can replace older lookup formulas with one function. In older or shared files, you may still see VLOOKUP, HLOOKUP, or INDEX with MATCH instead.
XLOOKUP is especially useful because it handles several common lookup problems directly. It can look to the left, return a custom message when no match exists, and search from the bottom of a list when the most recent match matters.
It is also useful for returning multiple columns in one step. If the return array includes several columns, the result can spill across adjacent cells and return the full matching record.
Wildcard matching is available too, but it is not automatic. If you want to use wildcards such as * or ?, set match_mode to 2.
if_not_found to control missing matches without wrapping the formula in IFERROR.search_mode=-1 when you need the last matching item instead of the first.This formula looks up the name "Bob" in one range and returns the ID from a different range to its left. That is a pattern that older functions such as VLOOKUP cannot handle directly.
=XLOOKUP("Bob", B2:B5, A2:A5)
Find the score for "Alice" in A2:A5 and return the result from B2:B5. Formula: =XLOOKUP("Alice", A2:A5, B2:B5).
Here the formula looks for a missing SKU and returns a custom message instead of an error. This is one of the most practical reasons many users prefer XLOOKUP over older lookup formulas.
=XLOOKUP("X-99", A2:A10, B2:B10, "Missing Item")
Find the ID associated with the name "Bob". Formula: =XLOOKUP("Bob", B2:B5, A2:A5).
With search_mode=-1, XLOOKUP searches from the bottom of the list upward. That means it returns the last matching occurrence rather than the first, which is useful in running logs or status histories.
=XLOOKUP("Update", B2:B100, C2:C100, , 0, -1)
Find "Charlie"; if missing, return "Not Found". Formula: =XLOOKUP("Charlie", A2:A5, B2:B5, "Not Found").
If the return array contains multiple columns, XLOOKUP can return the whole matching row in one formula. In modern Excel, that result spills into adjacent cells automatically.
=XLOOKUP(101, A2:A5, B2:D5)
Search for the last occurrence of "Sale" from bottom to top. Formula: =XLOOKUP("Sale", A1:A10, B1:B10, , 0, -1).
XLOOKUP searches one range and returns a matching result from another range.=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]).Tell your friends about this post