Field Guide

VLOOKUP vs XLOOKUP: which should you use?

Updated

For any new lookup in a current version of Excel, use XLOOKUP. It does everything VLOOKUP does and fixes VLOOKUP’s sharp edges: it can look in any direction, it matches exactly by default, and it handles a missing value on its own.

VLOOKUP is not broken, and it keeps one real advantage: it works in every version of Excel, while XLOOKUP needs Microsoft 365 or Excel 2021 and later. So the honest answer is “XLOOKUP for new work, VLOOKUP when compatibility demands it.” Here’s the detail behind that.

The differences at a glance

VLOOKUP XLOOKUP
Where it can look leftmost column only, returns to the right any column, either direction
How it returns a value a column number you count by hand a return array you select
Default match approximate (assumes sorted data) exact
No match found returns #N/A (wrap in IFNA) built-in if_not_found argument
Return more than one column no yes
Find the last match no yes (search from the bottom)
Works in Excel 2016 / 2019 yes no (Microsoft 365 / 2021+)

The same lookup, written both ways

Say you want the department for the ID in D2, from this table:

E2
fx
=XLOOKUP(D2, A2:A5, C2:C5)
A B C D E
1 ID Name Dept Find ID Dept
2 E-01 Amir Finance E-03 Ops
3 E-02 Bea Sales
4 E-03 Cai Ops
5 E-04 Dana Finance
The same task: find the ID from D2 and return its department.

With VLOOKUP you pass the whole table and count that Dept is the 3rd column, and you must remember FALSE for an exact match:

fx
=VLOOKUP(D2, A2:C5, 3, FALSE)

With XLOOKUP you name the search column and the return column directly, and exact is the default:

fx
=XLOOKUP(D2, A2:A5, C2:C5)

Both return Ops. The XLOOKUP version has nothing to miscount and no FALSE to forget.

Where XLOOKUP wins

If you’re mostly fighting the #N/A that VLOOKUP throws when it can’t match, the causes and fixes are in why your VLOOKUP returns #N/A, and the full feature tour is in the XLOOKUP guide.

Where VLOOKUP still makes sense

How to convert a VLOOKUP to XLOOKUP

The swap is mechanical:

  1. Keep the lookup value (the first argument is the same).
  2. Point the second argument at just the lookup column, A2:A5, not the whole A2:C5 table.
  3. Add the return column as the third argument instead of counting to a column number.
  4. Delete the FALSE, since XLOOKUP is exact by default.

So this:

fx
=VLOOKUP(D2, A2:C5, 3, FALSE)

becomes this:

fx
=XLOOKUP(D2, A2:A5, C2:C5)

Bottom line

New formula, current Excel: XLOOKUP. It looks any direction, matches exactly by default, survives inserted columns, and handles a missing value without an IFNA wrapper. Keep VLOOKUP when the file has to run in Excel 2016 or 2019, or when a working formula simply doesn’t need touching. Both of these search down a column; when your labels run across the top of a block instead, HLOOKUP is the horizontal version of the same idea. And if you migrate a shared model from one to the other, compare the two versions afterward so a silent change in a result can’t slip through.

Frequently asked questions

What is the difference between VLOOKUP and XLOOKUP?
VLOOKUP searches the leftmost column of a table and returns a value a fixed number of columns to the right, matching approximately unless you add FALSE. XLOOKUP searches any column and returns from any other in either direction, matches exactly by default, and takes a built-in argument for what to show when there is no match. XLOOKUP also replaces HLOOKUP.
Is XLOOKUP better than VLOOKUP?
For new formulas on a current version of Excel, yes. XLOOKUP removes VLOOKUP's main traps, the leftmost-column limit, the approximate-match default, and the hard-coded column number that breaks when a column is inserted. VLOOKUP's one real advantage is that it works in every version of Excel, while XLOOKUP needs Microsoft 365 or Excel 2021 and later.
Should I replace all my VLOOKUPs with XLOOKUP?
There is no need to rewrite working formulas just to modernize them, and if the file is shared with people on Excel 2016 or 2019 you should not, because XLOOKUP shows a #NAME? error there. For new formulas, and when you are already reworking a sheet, XLOOKUP is the safer default. If you do convert a shared model, compare the versions afterward to confirm no result changed.
Can XLOOKUP look to the left?
Yes. This is the headline difference. VLOOKUP can only return a column to the right of the one it searches, because it looks in the leftmost column of the table. XLOOKUP takes a separate lookup array and return array, so the answer can sit on either side of the value you search for.
Why would anyone still use VLOOKUP?
Compatibility. VLOOKUP works in every version of Excel, including 2016 and 2019, where XLOOKUP is unavailable. It is also familiar, and for a simple left-to-right exact-match lookup (with FALSE as the fourth argument) it does the job fine.

Catch the errors before they ship

Reviewing a change to a model? Compare the two versions in your browser and see every changed cell, formula, and value. It's free, and nothing leaves your computer.