How to use XLOOKUP in Excel
XLOOKUP is the modern replacement for VLOOKUP. It looks in one column and returns from another, in any direction, and it can show your own message when nothing is found.
Syntax
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
lookup_value- What you are looking for.
lookup_array- The single column to search in.
return_array- The column to return from. It can be to the left or the right.
if_not_found- Optional. What to show when there is no match, such as
"Not found".
Try it now · free, no sign-up
Find an ID from a name
- In G2, return the ID for the name in F2. The ID column is to the left of Name, which VLOOKUP cannot do.
- Zoe is not on the list. In G3, look up F3 but show
Not foundinstead of #N/A.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | ID | Name | Department | Salary | Find name | ID | |
| 2 | E104 | Megan | Finance | 72,000.00 | Priya | ||
| 3 | E101 | Carlos | HR | 58,000.00 | Zoe | ||
| 4 | E106 | Priya | IT | 91,000.00 | |||
| 5 | E103 | Tyler | Sales | 54,000.00 | |||
| 6 | E102 | Jasmine | IT | 86,000.00 | |||
| 7 | E105 | Ethan | Finance | 67,000.00 |
Loading the live spreadsheet…
Why XLOOKUP is easier than VLOOKUP
You pick the search column and the return column separately, so there is no column number to count and nothing breaks when someone inserts a column. It defaults to an exact match, so there is no FALSE to forget.
Which Excel versions have XLOOKUP?
Microsoft 365, Excel 2021 and later, and Excel for the web. Excel 2019 and older do not, which is why many interview tests still ask for VLOOKUP or INDEX MATCH.
Common mistakes
- #VALUE!
- The lookup and return columns are different sizes.
B2:B7andA2:A8will not work together. - #NAME?
- Your Excel is older than 2021 and does not have XLOOKUP. Use INDEX MATCH instead.
- #N/A
- Nothing matched. Add the fourth argument to show a message instead.
Practice it until it sticks
ExcelFluent has 42 hands-on lessons, from SUM to XLOOKUP, plus 5 real work projects and a final challenge that uses everything. Every answer is checked instantly. The first 5 lessons and 1 work project (an invoice with tax) are free.
Start the free lessons → Open the full XLOOKUP lessonFrequently asked questions
Can XLOOKUP return more than one column?
Yes. If the return array is several columns wide (for example C2:D7), the result spills across into the cells to the right.
Is XLOOKUP case sensitive?
No. "priya" and "Priya" match.
XLOOKUP or INDEX MATCH?
XLOOKUP is simpler to write. INDEX MATCH works in every version of Excel. If the test does not say, either is fine.