AnalystPracticeGuides
DashboardSign up

XLOOKUP vs VLOOKUP: what's the difference and which should you use?

Use XLOOKUP if your Excel has it. It matches exactly by default, can look left, handles missing values on its own, and doesn't break when someone inserts a column. You still need to know VLOOKUP, because older files, older Excel versions and many job interviews use it.

Watch it solved. Mistake 6: an inserted column breaks VLOOKUP, XLOOKUP doesn't, from 4:10, in our video “VLOOKUP in Excel: 10 Common Mistakes and How to Fix Them”. Pressing play loads the video from YouTube (privacy). Open on YouTube

Quick comparison

VLOOKUPXLOOKUP
Default matchApproximate, unless the last argument is FALSEExact
Return a column to the leftNoYes
Value not found#N/A, so you wrap it in IFERROR or IFNABuilt-in "if not found" argument
Someone inserts a columnThe column number can point to the wrong columnKeeps working, because you select the return range
Search from the bottom upNoYes (search mode -1)
Available inEvery Excel version and Google SheetsExcel for Microsoft 365, Excel 2021 and later, Excel for the web, Google Sheets

How do you write the same lookup with both?

The orders table has a product code in B2, and the price list is in E2:G7, with codes in column E and prices in column G.

=VLOOKUP(B2,E2:G7,3,FALSE)

=XLOOKUP(B2,E2:E7,G2:G7)

VLOOKUP needs the whole table and a column number (3 = the third column of E:G). XLOOKUP needs only the column to search and the column to return.

Why does VLOOKUP sometimes return a wrong value with no error?

Because its default is approximate match. If you leave out the last argument, VLOOKUP assumes the first column is sorted and may return the nearest smaller value instead of #N/A. For exact matches, always end VLOOKUP with FALSE (or 0). XLOOKUP is exact unless you ask otherwise.

Can VLOOKUP look to the left?

No. VLOOKUP can only return columns to the right of the column it searches. To find a code from a product name in a column further right, use XLOOKUP, or INDEX with MATCH in older Excel:

=INDEX(E2:E7,MATCH(H2,G2:G7,0))

How do you handle values that aren't found?

XLOOKUP has a fourth argument for this:

=XLOOKUP(B2,E2:E7,G2:G7,"Not found")

With VLOOKUP you wrap the formula:

=IFNA(VLOOKUP(B2,E2:G7,3,FALSE),"Not found")

Common mistake: wrapping everything in IFERROR. It also hides real mistakes, such as a typo in the range, so prefer IFNA when you only expect missing values.

When should you still use VLOOKUP?

When the file must work in Excel 2019 or older, when you edit someone else's workbook built on VLOOKUP, and in interviews and tests that ask for it by name. Interviewers also like the follow-up question: why can't VLOOKUP return a column to the left? Now you know.

Try it yourself. Practise both functions in a real spreadsheet with instant feedback. The VLOOKUP lesson is a good start, then move on to XLOOKUP.
Practise VLOOKUP Practise XLOOKUP

← All free guides