XLOOKUP vs VLOOKUP: Which One Should You Actually Use?

Once people get comfortable with VLOOKUP, the same question comes up sooner or later: Excel keeps suggesting XLOOKUP, so should I switch?

Short answer: if everyone who opens your files uses Microsoft 365 or Excel 2021 and newer, yes, switch. If even one person on your team is still on Excel 2019 or older, wait. The rest of this post is the long answer, built around four situations where the difference actually shows up in day-to-day work.

XLOOKUP formula in Excel with a separate search range and return range
XLOOKUP takes a search column and a return column, so there is no column number to count.

If VLOOKUP itself is still new to you, read my VLOOKUP guide with examples first. This post assumes you already know how it works.

First, check if your Excel has XLOOKUP

XLOOKUP is available in Microsoft 365, Excel 2021, Excel 2024, Excel for the web and the Excel mobile apps. It is not available in Excel 2019 or Excel 2016.

The quickest test: click any empty cell and type =XLO. If XLOOKUP shows up in the list of suggestions, you have it. If nothing appears, you’re on an older version and VLOOKUP is still your tool.

This matters for sharing too. If you send a file with XLOOKUP formulas to someone on Excel 2019, they’ll see _xlfn. stuck in front of the formula, and as soon as that cell recalculates it turns into #NAME?.

Workbook used in this postFour sheets, one for each situation below, plus a practice sheet with answers (.xlsx, 25 KB).

Download the file

The same lookup, written both ways

Say you have invoice numbers in column A and amounts in column D, and you want the amount for the invoice typed in F2. Here’s the VLOOKUP most of us would write:

=VLOOKUP(F2,$A$2:$D$9,4,FALSE)

And here’s the XLOOKUP version:

=XLOOKUP(F2,$A$2:$A$9,$D$2:$D$9)

Read the second one out loud and it almost explains itself: look for F2 in column A, and bring back the matching value from column D. There’s no column number to count and no FALSE at the end, because XLOOKUP does an exact match unless you tell it otherwise.

That small change in how the formula is built is what fixes most of VLOOKUP’s problems. VLOOKUP needs one big table and a column number. XLOOKUP needs two separate ranges: where to search, and what to return.

VLOOKUP XLOOKUP
Can return a value from the left No Yes
Match type if you leave it out Approximate Exact
Someone inserts a column in the table Can pick the wrong column Keeps working
Custom message when nothing is found Needs IFERROR Built in
Find the last match instead of the first No Yes
Works in Excel 2016 and 2019 Yes No

Situation 1: The ID you have is in the last column

This happens all the time with data exported from billing or accounting software. The customer ID sits at the far right, the customer name is at the far left, and you need to go from ID to name.

XLOOKUP finding customer name and city from a Customer ID in the last column, while VLOOKUP shows #N/A
XLOOKUP finds the name and city from the ID in column D. VLOOKUP, trying the same thing, returns #N/A.

VLOOKUP simply can’t do this. It only searches the first column of the range you give it, so it looks for C-205 among the customer names, doesn’t find it, and returns #N/A (row 7 in the screenshot).

The old fix was to cut and paste the ID column to the front, or to learn INDEX and MATCH. With XLOOKUP you just point it at the right columns:

=XLOOKUP(F2,$D$2:$D$9,$A$2:$A$9)

Search in column D, return from column A. Want the city instead? Change only the last range to $B$2:$B$9.

Situation 2: Someone inserts a column in the middle

This is the one that worries me most with VLOOKUP, because nothing turns red. The formula keeps working. It just starts giving the wrong answer.

On sheet 2, the VLOOKUP was written when the table had three columns: invoice number, party and amount. The formula asked for column 3, which was the amount. Then someone inserted a GST Rate column before the amount.

VLOOKUP returning GST rate instead of amount after a new column was inserted, XLOOKUP still returning the amount
Column C (GST Rate) was added later. VLOOKUP still asks for column 3 and now returns the GST rate, while XLOOKUP still returns the amount.

Excel stretches the range to include the new column, but the 3 in the formula stays a 3. So VLOOKUP now returns the GST rate (18%, 12%) instead of the invoice amount. If this sheet feeds a report, those wrong numbers travel quietly into it.

XLOOKUP doesn’t have this problem. Its return range was $C$2:$C$9 before the insert, and Excel automatically shifted it to $D$2:$D$9 along with the data, so it still returns 52,900 for INV-1045.

If you keep using VLOOKUP in shared files, protect yourself: after anyone changes the layout of a lookup table, spot-check a few results by hand.

Situation 3: The code isn’t in the list

Someone types K-19, but your stock list only goes up to K-18. With VLOOKUP you’d wrap the formula in IFERROR to avoid the ugly #N/A:

=IFERROR(VLOOKUP(E3,$A$2:$C$9,3,FALSE),"Not in list")

XLOOKUP has a spot for that message right inside the formula. It’s the fourth argument:

=XLOOKUP(E3,$A$2:$A$9,$C$2:$C$9,"Not in list")
XLOOKUP if_not_found argument showing Not in list, compared with IFERROR and VLOOKUP
Same result, shorter formula. The “Not in list” message sits inside XLOOKUP itself.

Both give the same result here, so why does it matter? IFERROR hides every error, including ones caused by a typo in your own formula. XLOOKUP’s message only appears when the value genuinely isn’t found. If you’ve made some other mistake, you’ll still see it.

Situation 4: You want the latest entry, not the first

This one is very common in accounts and purchase work. You have a purchase register where the same item appears many times, and you want the most recent rate.

XLOOKUP with search mode -1 returning the latest purchase rate while VLOOKUP returns the first rate
Sugar was bought three times. VLOOKUP returns the first rate (blue). XLOOKUP with -1 returns the latest one from row 7 (green).

VLOOKUP always stops at the first match from the top, so for sugar it gives you 2,050, the rate from early September. XLOOKUP can search from the bottom up instead. That’s the sixth argument, set to -1:

=XLOOKUP(F2,$B$2:$B$11,$D$2:$D$11,"",0,-1)

The empty quotes are the not-found message (left blank here), 0 means exact match, and -1 means start from the last row. Now sugar returns 2,180, the October rate from Mittal & Sons. As long as your register is in date order, this always gives you the latest rate, even after you add new rows below.

When I’d still pick VLOOKUP

XLOOKUP is the better formula, but there are honest reasons to stay with VLOOKUP for now:

  • Your file goes to people on older Excel. This is the big one. Many offices still run Excel 2016 or 2019 on some machines. A file that breaks on the accountant’s computer is worse than a file with slightly older formulas.
  • The sheet already works. If a monthly template has been running fine for years, there’s no prize for rewriting every formula in it. Use XLOOKUP in new work and leave the old file alone.
  • Your team only knows VLOOKUP. A formula your colleagues can read and fix has real value.

One thing that is not a reason anymore: grade and commission slabs. XLOOKUP handles those too with match mode -1 (exact match or the next smaller value), and unlike VLOOKUP with TRUE, the slab table doesn’t even need to be sorted.

Two mistakes people make when they switch

The two ranges are different sizes

If you search in A2:A9 but return from D2:D10, XLOOKUP gives #VALUE!. Both ranges must start and end on the same rows. When you select them with the mouse, keep an eye on the row numbers.

Forgetting to lock both ranges

With VLOOKUP you lock one table. With XLOOKUP there are two ranges, and both need dollar signs before you drag the formula down. Select each range in the formula bar and press F4.

Try it yourself

The last sheet in the download file, Practice, has three small tasks: find the plan for two customer IDs, and find the latest rate for tea leaves from the purchase register. Write the XLOOKUP formulas yourself first. The answers are a few rows below the questions.

If you’ve been using VLOOKUP for years, give XLOOKUP a week on your new sheets. After that, counting columns starts to feel like extra work. Just keep VLOOKUP for the files that still have to open on older versions of Excel.

If you want to learn Excel properly, from the basics to Pivot Tables, MIS reports and dashboards, have a look at my Advance Excel Course. It has 90 video chapters, explained in Hindi.

Written by Nazim KhanMBA (Finance), with 10+ years in accounts, finance and MIS reporting. He teaches Excel on the Business Excel YouTube channel and here on BusinessExcel.in. More about Nazim