Look up a product with XLOOKUP

Beginner

When you need to find a value in a table, XLOOKUP is Excel's most modern lookup tool. It has a cleaner syntax than VLOOKUP and works in any direction.

XLOOKUP searches for a value in one column and returns a value from a different column in the same row.

The three required arguments are:

=XLOOKUP(lookup_value, lookup_array, return_array)

  • lookup_value: the value you want to find (a product code, a name, an ID, etc.)
  • lookup_array: the column to search in
  • return_array: the column to return a value from

Your task

A product catalog is listed in rows 1–8 (product code, product name, category). Below it, cell B10 contains a product code you want to look up.

  1. Click cell B11.
  2. Write an XLOOKUP formula that finds the product code in B10 within the product code column (A2:A8).
  3. Return the matching value from the category column (C2:C8).
  4. Press Enter.

When you're done, B11 should show the category for that product code.

Need some help?

Hint 1

XLOOKUP returns an exact match by default. If the product code in B10 is not found in A2:A8, Excel will display a #N/A error instead of a value. This is different from VLOOKUP, which requires a separate argument to force exact matching.

Hint 2

The return_array should be the category column (C2:C8), not the product name column (B2:B8).

Related function(s)