XLOOKUP

Finds a value in one list, and returns the matching value from another.

How it’s written

XLOOKUP(find, where_to_look, what_to_return, if_not_found)

Example

ABC
1CodeProductPrice
2P-10Lamp45
3P-20Desk210
4P-30Chair120
=XLOOKUP("P-20",A2:A4,C2:C4)

Result: 210

Finds P-20 and returns its price.

Try it yourself

Open a live sheet with this example, and type the formula yourself. It takes a moment to load.

Worth knowing

The fourth part replaces #N/A with your own message.

Practice it properly

Find it with XLOOKUP gives you real tasks, with your formulas tested on data you haven’t seen.

Start the lesson

Guides that use XLOOKUP

Related functions