Lookup and referenceExcel 2021

XLOOKUP

Search one range and return the corresponding item from another, with optional fallback text.

Syntax

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

Worked example

Find product P4 in the first array and take its corresponding price from the second.

=XLOOKUP("P4",{"P2","P4","P9"},{18,35,27},"Missing")

Result 35

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor