Excel functions / Lookup & reference

XLOOKUP

Searches one range and returns the matching item from another. A modern, simpler replacement for VLOOKUP and HLOOKUP.

Syntax=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])

Arguments

lookup_valueWhat you are searching for.
lookup_arrayThe column or row to search.
return_arrayThe column or row to return a value from.
if_not_foundOptional. What to show when there is no match, instead of #N/A.

How it works

XLOOKUP asks two simple questions: where should I look, and what should I bring back? You point at the two ranges directly, so there is no column number to count.

It matches exactly by default, it can return values to the left of the search column, and it has its own "not found" message built in. It is available in Excel 2021 and Microsoft 365.

Example

F2=XLOOKUP("Chair",B2:B5,C2:C5,"Not found")
ABCDEF
1CodeProductPriceStock
2A10Lamp$25.0012$85.00
3B20Desk$140.003
4C30Chair$85.007
5D40Shelf$60.000
6

Result: $85.00. Looks for Chair in the product names and returns the price from the same row.

Tips

Practise XLOOKUP

Try it yourself in a real spreadsheet, with instant feedback on every answer.

Start the exercise

Related