Skip to content

XLOOKUP

Finds a value in one column and returns the matching value from another. It replaced VLOOKUP, and it can look left.

Quick answer

=XLOOKUP(what, where, return)

Tell it what to find, where to look, and what to bring back. Add a fourth argument to show your own message instead of #N/A.

Excel for Microsoft 365 (Windows and Mac)Not available in Excel 2019 or earlier
Regions.xlsx3 steps

Step 1 · Watch

Find East's manager in B9.

B9=XLOOKUP(A9,A2:A7,B2:B7)

XLOOKUP found East in A2:A7 and returned the manager in the same row of B2:B7. Your turn next.

Steps 2 and 3 · Your turn

Task 1 of 2

In C9, return East's Q1 revenue.

Answer in C9.

C9
A
B
C
1
Region
Manager
Q1 revenue
2
North
P. Shah
$48,200
3
South
T. Novak
$31,750
4
East
R. Okafor
$42,900
5
West
J. Alvarez
$37,400
6
Central
M. Chen
$22,650
7
Online
A. Kim
$56,300
8
Region
Manager
Q1 revenue
9
East
R. Okafor
10
J. Alvarez
01

Three arguments do the work.

Two more are optional. Hover, focus or press an argument to see what it points at.

=XLOOKUP(,,,,)

C9=XLOOKUP(A9,A2:A7,C2:C7,"Not found",0)

A
B
C
1
Region
Manager
Q1 revenue
2
North
P. Shah
$48,200
3
South
T. Novak
$31,750
4
East
R. Okafor
$42,900
5
West
J. Alvarez
$37,400
6
Central
M. Chen
$22,650
7
Online
A. Kim
$56,300
8
9
East
$42,900

Each argument has its own colour, the way Excel colours references while you edit. The result lands in C9.

02

Three ways you'll use it.

Change the inputs and watch the formula and the sheet respond.

Example 1

Exact match, with a fallback

Look up a price by SKU. If the SKU isn't in the list, show a message instead of an error.

Find SKU
if_not_found

Found SKU-102 in row 3 and returned its price, $89.

B8=XLOOKUP(A8,A2:A5,C2:C5)

A
B
C
1
SKU
Product
Price
2
SKU-101
Desk lamp
$39
3
SKU-102
Monitor arm
$89
4
SKU-103
Laptop stand
$54
5
SKU-104
USB-C hub
$29
6
7
Find SKU
Price
8
SKU-102
$89

Example 2

Approximate match, for tiers

Commission bands, tax brackets and shipping rates all have a starting value per row. Match mode -1 drops to the band you're in.

$30,000
match_mode

$30,000 isn't in the list. Match mode -1 drops to the next smaller tier, $25,000, so the rate is 6%.

B8=XLOOKUP(A8,A2:A5,B2:B5,,-1)

A
B
C
1
Sales from
Rate
2
$0
2%
3
$10,000
4%
4
$25,000
6%
5
$50,000
8%
6
7
Sales
Rate
Commission
8
$30,000
6%
$1,800

Example 3

Two-way lookup

Pick a row and a column at once by nesting one XLOOKUP inside another. The inner one picks the column.

Region
Quarter

The inner XLOOKUP finds Q3 in the header row and returns that whole column. The outer one finds South in it: $36,200.

C8=XLOOKUP(A8,A2:A5,XLOOKUP(B8,B1:E1,B2:E5))

A
B
C
D
E
1
Q1
Q2
Q3
Q4
2
North
48,200
51,400
49,800
55,100
3
South
31,750
33,900
36,200
38,400
4
East
42,900
40,100
44,600
47,300
5
West
37,400
39,800
41,200
43,900
6
7
Region
Quarter
Revenue
8
South
Q3
$36,200
03

Why it replaced VLOOKUP.

VLOOKUP counts columns. XLOOKUP points at them. Insert a column and see which one survives.

A
B
C
1
Region
Manager
Q1 revenue
2
North
P. Shah
$48,200
3
South
T. Novak
$31,750
4
East
R. Okafor
$42,900
5
West
J. Alvarez
$37,400
6
Central
M. Chen
$22,650
7
Online
A. Kim
$56,300
8
9
East

VLOOKUP

B9=VLOOKUP(A9,A2:C7,3,FALSE)

$42,900 · East’s revenue

XLOOKUP

B9=XLOOKUP(A9,A2:A7,C2:C7)

$42,900 · East’s revenue

Someone adds a Target column next to Region.

VLOOKUP compared with XLOOKUP
VLOOKUPXLOOKUP
Default matchApproximate, unless you add FALSEExact
Look leftNoYes
Survives an inserted columnNo, the column number is fixedYes
Your own “not found” messageNeeds IFERROR or IFNABuilt in
Search from the bottomNoYes, search_mode -1
Return several columns at onceNoYes, the results spill
Works in Excel 2019 and earlierYesNo
04

When it goes wrong.

Three errors cause most XLOOKUP trouble. Fix each formula yourself, or press “Show me”.

#N/A

The value isn’t there

Midwest isn’t in A2:A5. That’s correct behaviour, but #N/A looks broken in a report. Add a fourth argument to say what to show instead.

A
B
1
Region
Manager
2
North
P. Shah
3
South
T. Novak
4
East
R. Okafor
5
West
J. Alvarez
6
7
Midwest
#N/A

Shows #N/A.

#VALUE!

Ranges of different sizes

lookup_array runs to row 5 but return_array stops at row 4. Both arrays must be the same height. Fix the second range.

A
B
1
Region
Manager
2
North
P. Shah
3
South
T. Novak
4
East
R. Okafor
5
West
J. Alvarez
6
7
East
#VALUE!

Shows #VALUE!.

#N/A

A number stored as text

The IDs in column A are text, but A7 is a number, so they never match. Turn A7 into text with A7&"".

A
B
1
Staff ID
Name
2
1041
Ana Ruiz
3
1042
Ben Cole
4
1043
Cara Diaz
5
1044
Dev Rao
6
7
1043
#N/A

Shows #N/A.

05

Questions people ask.

Is XLOOKUP better than VLOOKUP?

For most jobs, yes. It matches exactly by default, can look left, and keeps working when someone inserts a column. Use VLOOKUP or INDEX/MATCH only when the file has to work in Excel 2019 or earlier.

Why does XLOOKUP return #N/A?

It couldn't find the lookup value. The usual causes are a typo, an extra space, a number stored as text, or searching the wrong column. Add a fourth argument, such as `"Not found"`, to show your own message instead.

Does XLOOKUP work in Excel 2019?

No. It's in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. In Excel 2019 and earlier the formula returns `#NAME?`.

Can XLOOKUP return more than one column?

Yes. Make return_array several columns wide, for example `B2:D7`, and the matching values spill into the cells to the right. If those cells aren't empty, you get `#SPILL!`.

Is XLOOKUP case-sensitive?

No. Looking up "east" finds "East". For a case-sensitive match, look up TRUE in an EXACT test: `=XLOOKUP(TRUE, EXACT(A2:A7, A9), B2:B7)`.

How do I find the last match instead of the first?

Set search_mode, the sixth argument, to -1: `=XLOOKUP(E2, B2:B8, C2:C8, "No count", 0, -1)`. XLOOKUP then searches from the bottom and returns the last match.

How do I look up with two criteria?

Join the criteria and the columns with `&`: `=XLOOKUP(G1&G2, A2:A10&B2:B10, C2:C10)`. Another way is to multiply two tests and look up 1: `=XLOOKUP(1, (A2:A10=G1)*(B2:B10=G2), C2:C10)`.

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 3

In B9, return the depot for the region in A9.

Answer in B9.

B9
A
B
C
1
Region
Depot
Q1 revenue
2
North
D-214
48,200
3
South
D-187
31,750
4
East
D-330
42,900
5
West
D-145
37,400
6
Central
D-402
22,650
7
Online
D-519
56,300
8
Region
Depot
Q1 revenue
9
East
10
D-145

Common mistakes

  • #N/A means the lookup value isn't in lookup_array. Check for typos and stray spaces (TRIM removes them), and make sure you searched the right column. If a missing value is expected, give if_not_found a message instead of leaving the error.
  • #VALUE! usually means lookup_array and return_array are different sizes, such as A2:A11 and D2:D10. Make both ranges start and end on the same rows.
  • Numbers stored as text don't match real numbers: 1043 won't find "1043". Convert the column with VALUE or Text to Columns, or convert the lookup value to text with A7&"".
  • Ranges slide when you fill a lookup down. Lock lookup_array and return_array with dollar signs, such as $A$2:$A$11, and leave lookup_value relative.
  • When the matching cell in return_array is empty, XLOOKUP returns 0, not a blank. That can look like a real zero in a report.
  • search_mode 2 and -2 assume sorted data. On unsorted data they return wrong results without an error, so leave search_mode at the default unless the list is sorted and very large.

Learn XLOOKUP in a real sheet.

XLOOKUP is taught in Lookups and references, lesson 1: XLOOKUP basics. Each lesson is a short, graded exercise like the one above.