Excel XLOOKUP Function
XLOOKUP searches a row or column for a lookup value and returns the matching value from another row, column, or table.
Use it for modern lookup formulas, such as finding a price from a SKU, a department from an employee ID, or the latest status tied to an account number.
XLOOKUP syntax & arguments
Syntax
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
-
1
lookup_value
RequiredThe value to find. It can be text, a number, a cell reference, or the result of another formula.
-
2
lookup_array
RequiredThe row or column where Excel should search for
lookup_value. -
3
return_array
RequiredThe row, column, or table of values to return from the matching position.
-
4
if_not_found
OptionalThe fallback result to return when no match is found. If omitted, Excel returns
#N/A. -
5
match_mode
OptionalControls exact, approximate, or wildcard matching:
0— Exact match: Returns a result only when XLOOKUP finds the lookup value exactly. This is the default.-1— Exact or next smaller: Returns an exact match, or the next smaller item when no exact match exists.1— Exact or next larger: Returns an exact match, or the next larger item when no exact match exists.2— Wildcard match: Allows wildcard characters such as asterisks and question marks in the lookup value.
-
6
search_mode
OptionalControls the direction or method of the search:
1— First to last: Searches from the first item to the last item. This is the default.-1— Last to first: Searches from the last item to the first item.2— Binary ascending: Uses binary search on data sorted in ascending order.-2— Binary descending: Uses binary search on data sorted in descending order.
Example
=XLOOKUP(A2, E2:E10, F2:F10, "Not found")
Find the value from A2 in E2:E10, return the matching value from F2:F10, or return "Not found" when there is no match.
XLOOKUP caveats
XLOOKUP removes many older lookup limitations, but the lookup and return arrays still need to be designed carefully.
-
Array alignment matters
lookup_arrayandreturn_arraymust line up by position. A match in the fifth lookup item returns the fifth item from the return array. -
Exact match is the default
Unlike the older VLOOKUP and HLOOKUP functions, XLOOKUP looks for an exact match unless you choose a different
match_mode. -
The fallback only handles missing matches
if_not_foundreplaces#N/Awhen no match exists, but it does not fix unrelated errors in the lookup or return data. -
Binary search requires sorted data
Only use
search_modevalues2or-2when the lookup array is sorted in the matching direction.
Replacing older lookups? XLOOKUP can return values on either side of a vertical lookup or above and below a horizontal lookup, while the older VLOOKUP can only return values to the right and the older HLOOKUP can only return values below the lookup row.
Intro XLOOKUP practice problems
No intro XLOOKUP problems are currently available.
Advanced XLOOKUP practice problems
Use XLOOKUP alongside other Excel functions in realistic, less-prescriptive challenges.
Price With Discount
Country-Specific Date Display
Forecast Gap
On-Call Issue Employee
Order Totals
Project Due Dates
Promo Eligibility Check
Race Podium Names
Tier Payout Limits
Top Team Rep