ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 43 · Lookups

XLOOKUP in Excel

XLOOKUP is the newer, simpler lookup. You say what to find, where to look and where the answer is. It can look left or right and has a built-in "not found" message.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Use XLOOKUP to find things
  • Show a message when nothing is found

How it works

XLOOKUP has four parts:

  • what to find
  • where to look
  • where the answer is
  • what to show if it's not found

XLOOKUP works in newer versions of Excel.

Formulas at a glance

=XLOOKUP(value, lookup_range, return_range, if_not_found)The pattern to follow

Example

Write the formula to find the product name for code P-104 (A2). Show "Not found" if it's missing.

ABCDEF
1CodeProductPriceCodeProductPrice
2P-104P-101Pencil$0.50
3P-109P-102Eraser$0.75
4P-101P-103Marker$2.40
5P-102P-104Ruler$1.20
6P-105Binder$4.95
7Found

Click B2 and type =XLOOKUP(A2,$D$2:$D$6,$E$2:$E$6,"Not found"), then press Enter.

The answer is Ruler.

When to use it

  • Any lookup in Excel 2021 or Microsoft 365
  • Looking up to the left of the search column
  • Lookups that need a friendly "not found" message

Common mistakes

  • Seeing #NAME?XLOOKUP needs Excel 2021 or newer, or Microsoft 365. Use VLOOKUP or INDEX/MATCH in older Excel.
  • Ranges of different sizesThe look-in range and the answer range must be the same size.
  • Using a column number like VLOOKUPXLOOKUP uses a range for the answer, not a number.

Quick check

What kind of match does XLOOKUP use unless you say otherwise?

  1. Close match
  2. Exact match
  3. Wildcard
  4. None
Show the answer

B. Exact match It looks for an exact match.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

XLOOKUP in Excel: how it works, with examples · ExcelUnpack