How to use XLOOKUP in Excel

Learn how to use XLOOKUP in Excel to search ranges, return values in any direction, handle missing data, and replace VLOOKUP with hands-on practice.

Syntax

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

Arguments

What XLOOKUP does

XLOOKUP searches a range for a specific value and returns a matching value from another range. It defaults to an exact match, so you do not need to add extra flags for everyday lookups. Here, the formula searches for the item in A6 and returns its price.

ItemCategoryPrice
EspressoDrink3
CroissantBakery4
MuffinBakery3
TeaDrink2
CroissantFind Price

Formula: =XLOOKUP(A6,A2:A5,C2:C5) → 4

Look up to the left

Earlier functions like VLOOKUP can only return values to the right of your lookup column. With XLOOKUP, your return range can sit anywhere. Here, the formula looks up bib 425 in column B and returns the runner name from column A on its left.

RunnerBibDistance
Ananya2045
Bilal31810
Chloe42521
Dan51210
425Find Runner

Formula: =XLOOKUP(B6,B2:B5,A2:A5) → Chloe

Handle missing values cleanly

When a lookup value does not exist, Excel normally returns a #N/A error. You can use XLOOKUP’s fourth argument to show a friendly fallback message instead of wrapping your formula in IFERROR. In this example, searching for missing order 1099 returns Not Found.

Order IDCustomerStatus
1001AminaShipped
1002CarlosDelivered
1003DeepaPending
1099Find Status

Formula: =XLOOKUP(A5,A2:A4,C2:C4,"Not Found") → Not Found

Common mistake: Mismatched range sizes

Both lookup_array and return_array must have the exact same number of rows or columns. If you search four cells in A2:A5 but supply five cells in C2:C6 to return from, Excel cannot align the rows and displays a #VALUE! error. Always make sure your two ranges start and end on matching row numbers.

Related guides

VLOOKUPINDEX MATCH