ID EN
#Dynamic array

XLOOKUP

Excel Functions

Look up values in range or array

Syntax

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

Arguments

Parameter Description
lookup The lookup value.
lookup_array The array or range to search.
return_array The array or range to return.
if_not_found [optional] Value to return if no match found.
match_mode [optional] 0 = exact match (default), -1 = exact match or next smallest, 1 = exact match or next larger, 2 = wildcard match, 3 = regex match.
search_mode [optional] 1 = search from first (default), -1 = search from last, 2 = binary search ascending, -2 = binary search descending.

Return Value

Matching value in return array

Details

XLOOKUP is Excel's modern all‑in‑one lookup function. It lets you search a row or column for a value and retrieve the corresponding value from another range, without the frustrating limitations that plagued older functions like VLOOKUP, HLOOKUP, and LOOKUP. It can even return more than one corresponding value at the same time. With a straightforward syntax, XLOOKUP can be configured to support wildcards, regex, approximate‑match, reverse, and high‑speed binary searches. For a quick demonstration of XLOOKUP in action, watch this 3-minute video: By default, XLOOKUP will perform an exact match. In the example below, XLOOKUP is configured to retrieve the Sales amount from column E based on an exact match of the movie titles in column B. The formula in H5 is: More detailed explanation here. To

Examples

Exact match

By default, XLOOKUP will perform an exact match. In the example below, XLOOKUP is configured to retrieve the Sales amount from column E based on an ex

EXCEL
=XLOOKUP(H4,B5:B9,E5:E9)
Approximate match

To enable an approximate match, provide a value for the match_mode argument. In the example below, XLOOKUP is used to calculate a discount based on qu

EXCEL
=XLOOKUP(E5,B5:B9,C5:C9,,-1)
Multiple values

XLOOKUP can return more than one value at the same time (i.e., an array of values) with one formula. The example below shows how XLOOKUP can be used t

EXCEL
=XLOOKUP(B5,B8:B15,C8:E15)
Two-way lookup

XLOOKUP can perform a two-way lookup by nesting one XLOOKUP inside another. In the example below, the "inner" XLOOKUP retrieves an entire row (all val

EXCEL
=XLOOKUP(I6,C4:F4,XLOOKUP(I5,B5:B9,C5:F9))
Not found message

When XLOOKUP can't find a match, it returns the #N/A error, like other match functions in Excel. Unlike the other match functions, XLOOKUP supports an

EXCEL
=XLOOKUP(H4,B5:B9,E5:E9,"Not found")
Wildcard match

XLOOKUP supports wildcards to enable partial match lookups. Set the match_mode argument to 2 to enable wildcards in XLOOKUP. In the example below, XLO

EXCEL
=TRANSPOSE(XLOOKUP("*"&G4&"*",data[Title],data,,2))

See Also

XMATCH FILTER VLOOKUP INDEX MATCH LOOKUP HLOOKUP