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.
Found SKU-102 in row 3 and returned its price, $89.
B8=XLOOKUP(A8,A2:A5,C2:C5)
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.
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.
Two more are optional. Hover, focus or press an argument to see what it points at.
C9=XLOOKUP(A9,A2:A7,C2:C7,"Not found",0)
Each argument has its own colour, the way Excel colours references while you edit. The result lands in C9.
Change the inputs and watch the formula and the sheet respond.
Example 1
Look up a price by SKU. If the SKU isn't in the list, show a message instead of an error.
Found SKU-102 in row 3 and returned its price, $89.
B8=XLOOKUP(A8,A2:A5,C2:C5)
Example 2
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 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)
Example 3
Pick a row and a column at once by nesting one XLOOKUP inside another. The inner one picks the column.
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))
VLOOKUP counts columns. XLOOKUP points at them. Insert a column and see which one survives.
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 | XLOOKUP | |
|---|---|---|
| Default match | Approximate, unless you add FALSE | Exact |
| Look left | No | Yes |
| Survives an inserted column | No, the column number is fixed | Yes |
| Your own “not found” message | Needs IFERROR or IFNA | Built in |
| Search from the bottom | No | Yes, search_mode -1 |
| Return several columns at once | No | Yes, the results spill |
| Works in Excel 2019 and earlier | Yes | No |
Three errors cause most XLOOKUP trouble. Fix each formula yourself, or press “Show me”.
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.
Shows #N/A.
lookup_array runs to row 5 but return_array stops at row 4. Both arrays must be the same height. Fix the second range.
Shows #VALUE!.
The IDs in column A are text, but A7 is a number, so they never match. Turn A7 into text with A7&"".
Shows #N/A.
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.
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.
No. It's in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. In Excel 2019 and earlier the formula returns `#NAME?`.
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!`.
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)`.
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.
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)`.
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.
#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.A7&"".$A$2:$A$11, and leave lookup_value relative.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.XLOOKUP is taught in Lookups and references, lesson 1: XLOOKUP basics. Each lesson is a short, graded exercise like the one above.