XLOOKUP vs VLOOKUP: what’s different, and which to use

XLOOKUP and VLOOKUP both find a value in a table and return a value from the same row. VLOOKUP searches the first column of a table and returns the column whose number you give it. XLOOKUP searches any column you point it at, returns any other, matches exactly unless you ask it not to, and can show a message of your own when there’s no match. VLOOKUP works in every version of Excel; XLOOKUP needs Microsoft 365, Excel 2021 or later, or Excel for the web.

This guide puts the two side by side: a table of the differences, then each difference tried on a small table, with the formula for each function and the result it gives. After that come INDEX and MATCH, which one to use, how to turn a VLOOKUP into an XLOOKUP, and 7 exercises to practise both.

We ran every formula on this page through the practice sheet our lessons use. Each result you see is the one it returned.

XLOOKUP vs VLOOKUP at a glance

What differsXLOOKUPVLOOKUP
Excel versionsMicrosoft 365, Excel 2021 or later, and Excel for the webEvery version
Default matchExactApproximate, unless you add FALSE as the last argument
Which column it returnsThe range you give itThe column whose number you give it
A column to the leftYesNo: it searches the first column and returns from the right
After you insert a columnStill returns the same columnCan return the wrong column, because the number stays the same
When nothing matchesShows its fourth argument, or #N/AShows #N/A, so you wrap it in IFNA or IFERROR
Several columns at onceYes: give it a wider return rangeNo: one formula for each column
The last matchYes, with search mode -1No: always the first match
The next larger valueYes, with match mode 1No: an approximate match takes the next smaller value, in a sorted table
Wildcards (* and ?)With match mode 2Yes, with FALSE
Horizontal lookupsYes: give it a row to searchNo: HLOOKUP does that

For new work, XLOOKUP is the better choice: it has fewer ways to go wrong and does more. VLOOKUP still matters, because it works in every version of Excel, so older workbooks and Excel tests built on older versions use it.

The same lookup, written both ways

Most examples below use this list of six products, sorted by code.

The product list: codes, items, prices and stock
ABCD
1CodeItemPriceStock
2DL-4410Desk lamp24.0012
3FD-1005Folders1.80140
4NB-2041Notebook3.5085
5PN-1180Pens4.200
6ST-3302Stapler9.996
7TP-5120Tape2.2540

To find the stapler’s price, both functions need the code to look for. After that they ask for different things.

FormulaWhat it doesResult
=XLOOKUP("ST-3302",A2:A7,C2:C7)Searches the codes in A and returns the price from C.9.99
=VLOOKUP("ST-3302",A2:D7,3,FALSE)Searches the first column of A2:D7 and returns its 3rd column. FALSE asks for an exact match.9.99
  • XLOOKUP takes the column to search, A2:A7, and the column to return, C2:C7.
  • VLOOKUP takes the whole table, A2:D7. It always searches the table’s first column, and the 3 tells it to return the 3rd column.

Try it in your browser. This task comes from lesson 28 of Excel Foundations, our free course, and it checks your formula the way the course does. Either function works.

In B2, return the name for the staff ID in B1.

Example data for this task
ABCDEF
1Staff IDS104IDNameDepartment
2Name (your answer goes here)S101Ola MensahSales
3S102Priya NairFinance
4S103Tom BeckerSales
5S104Lerato DubeOperations
6S105Marco RossiFinance
7S106Aiko SatoOperations

Create a free account to carry on with the rest of Excel Foundations.

Seven differences between XLOOKUP and VLOOKUP

XLOOKUP matches exactly by default

VLOOKUP’s last argument is optional, and leaving it out asks for an approximate match. In an approximate match, VLOOKUP assumes the first column is sorted and returns the row of the largest value that isn’t bigger than the one you asked for. So a code with two digits swapped, ST-3320 instead of ST-3302, returns a real price.

FormulaWhat it doesResult
=VLOOKUP("ST-3320",A2:D7,3)No FALSE, so the match is approximate: ST-3320 isn’t on the list, and VLOOKUP returns the row before where it would sit.9.99
=VLOOKUP("ST-3320",A2:D7,3,FALSE)With FALSE, a code that isn’t on the list gives #N/A.#N/A
=XLOOKUP("ST-3320",A2:A7,C2:C7)XLOOKUP matches exactly unless you ask it not to.#N/A

The first formula returns the stapler’s price for a code that isn’t on the list, and nothing on the sheet says so. On a list that isn’t sorted, an approximate match can return a value from the wrong row too. So add FALSE to every VLOOKUP, unless you’re looking up bands such as tax rates or discounts.

XLOOKUP can return a column to the left

VLOOKUP searches the first column of its table, so the value it returns has to sit to the right of it. To find a code from an item’s name, the names would have to come first. XLOOKUP’s search and return ranges are separate, so they can sit either way round.

FormulaWhat it doesResult
=XLOOKUP("Tape",B2:B7,A2:A7)Searches the items in B and returns the code from A, to their left.TP-5120
=INDEX(A2:A7,MATCH("Tape",B2:B7,0))MATCH finds Tape’s position in B, and INDEX returns the code at that position in A.TP-5120

INDEX and MATCH does the same in every version of Excel. There’s more on it below.

Inserting a column can break VLOOKUP

VLOOKUP’s third argument is a number, so it can’t follow the column it counts to. Say someone inserts a Colour column between Item and Price.

The product list with a Colour column inserted
ABCDE
1CodeItemColourPriceStock
2DL-4410Desk lampBlack24.0012
3FD-1005FoldersBlue1.80140
4NB-2041NotebookWhite3.5085
5PN-1180PensBlack4.200
6ST-3302StaplerGrey9.996
7TP-5120TapeClear2.2540

Excel rewrites the ranges in both formulas for you: A2:D7 becomes A2:E7, and C2:C7 becomes D2:D7. It can’t rewrite the 3.

FormulaWhat it doesResult
=VLOOKUP("ST-3302",A2:E7,3,FALSE)Excel widened the table to A2:E7, but the 3 now points at the Colour column.Grey
=XLOOKUP("ST-3302",A2:A7,D2:D7)Excel moved C2:C7 to D2:D7, so XLOOKUP still returns the price.9.99

VLOOKUP now returns Grey, and nothing flags it, because a colour is a valid result. XLOOKUP points at the price column itself, so it still returns the price.

XLOOKUP has its own argument for no match

When there’s no match, both functions return #N/A. XLOOKUP’s fourth argument says what to show in its place. For VLOOKUP, wrap the formula in IFNA, which needs Excel 2013 or later, or in IFERROR.

FormulaWhat it doesResult
=XLOOKUP("ST-3320",A2:A7,C2:C7,"Not found")The fourth argument is what to show when nothing matches.Not found
=IFNA(VLOOKUP("ST-3320",A2:D7,3,FALSE),"Not found")IFNA replaces VLOOKUP’s #N/A with the message.Not found
=IFERROR(VLOOKUP("ST-3302",A2:D7,5,FALSE),"Not found")A typing slip: the table has 4 columns, not 5. IFERROR hides the #REF! behind Not found, for a code that is on the list.Not found
=IFNA(VLOOKUP("ST-3302",A2:D7,5,FALSE),"Not found")IFNA only replaces #N/A, so the mistake shows.#REF!

IFERROR replaces every error, not only #N/A. In the third formula the column number is past the edge of the table, and IFERROR turns the #REF! into Not found for a code that is on the list. IFNA lets that mistake show.

Try it here. This task comes from lesson 29 of Excel Foundations.

B1 holds an ID that isn't on the list. In B2, return the name, or Not found when there's no match.

Example data for this task
ABCDEF
1Staff IDS107IDNameDepartment
2Name (your answer goes here)S101Ola MensahSales
3S102Priya NairFinance
4S103Tom BeckerSales
5S104Lerato DubeOperations
6S105Marco RossiFinance
7S106Aiko SatoOperations

Create a free account to practise the rest of Excel Foundations.

XLOOKUP can return several columns at once

Give XLOOKUP a return range two or more columns wide and the results spill into the cells to the right. VLOOKUP returns one column, so the price and the stock take a formula each.

FormulaWhat it doesResult
=XLOOKUP("ST-3302",A2:A7,C2:D7)A return range two columns wide: the price and the stock spill into two cells.9.99 and 6
=VLOOKUP("ST-3302",A2:D7,3,FALSE)The price, from the 3rd column.9.99
=VLOOKUP("ST-3302",A2:D7,4,FALSE)The stock takes a second formula, with 4 for the 4th column.6

Spilled results need Microsoft 365, Excel 2021 or later, or Excel for the web, the same versions as XLOOKUP. If the cells to the right aren’t empty, Excel shows #SPILL! in place of the results.

XLOOKUP can search from the bottom

This log records each price change, oldest first, so a code whose price has changed more than once appears on several rows.

A log of price changes, oldest first
ABC
1DateCodeNew price
25 Jan 2026ST-33028.99
312 Jan 2026NB-20413.25
42 Feb 2026ST-33029.49
516 Mar 2026PN-11804.20
61 Apr 2026ST-33029.99
76 Apr 2026NB-20413.50

VLOOKUP returns the first match, which here is the oldest price. XLOOKUP’s sixth argument, the search mode, sets the direction: -1 searches from the last row up, so it returns the latest price, or the date of that change.

FormulaWhat it doesResult
=VLOOKUP("ST-3302",B2:C7,2,FALSE)VLOOKUP returns the first match: the oldest price.8.99
=XLOOKUP("ST-3302",B2:B7,C2:C7,,0,-1)Search mode -1 searches from the last row up, so XLOOKUP returns the latest price.9.99
=XLOOKUP("ST-3302",B2:B7,A2:A7,,0,-1)The same search, returning the date of that change from A, to the left.1 Apr 2026

The two commas leave the fourth argument empty, and the 0 keeps the exact match. In Excel 2019 and earlier, sort the log newest first, so the latest change is the first match.

XLOOKUP can find the next larger value

Some tables list the top of each band, such as delivery rates by weight: up to 1 kg, up to 5 kg and so on.

Delivery rates by the top weight of each band
AB
1Up to (kg)Rate
214.50
357.95
41012.50
52018.00

A 3.2 kg parcel falls in the up-to-5 kg band. Match mode 1 asks XLOOKUP for an exact match or the next larger value. VLOOKUP’s approximate match only goes the other way, to the next smaller value, so it returns the rate for parcels up to 1 kg.

FormulaWhat it doesResult
=XLOOKUP(3.2,A2:A5,B2:B5,,1)Match mode 1 takes an exact match or the next larger value: the up-to-5 kg band.7.95
=VLOOKUP(3.2,A2:B5,2,TRUE)An approximate VLOOKUP takes the next smaller value: the up-to-1 kg band.4.50

For VLOOKUP, you’d rebuild the table to list the bottom of each band instead. XLOOKUP’s match modes don’t need the table sorted, unless you also choose one of its binary search modes.

XLOOKUP vs INDEX and MATCH

INDEX and MATCH is the older way round VLOOKUP’s limits. MATCH finds the position of a value in one column, and INDEX returns the value at that position in another. It works in every version of Excel, looks left, and keeps working when someone inserts a column, because both ranges move with the sheet.

FormulaWhat it doesResult
=INDEX(C2:C7,MATCH("ST-3302",A2:A7,0))MATCH finds the code’s position in A, and INDEX returns the price at that position in C.9.99
=MATCH("ST-3320",A2:A7)No 0, so MATCH looks for an approximate match and returns the stapler’s position.5
=MATCH("ST-3320",A2:A7,0)With 0, a code that isn’t on the list gives #N/A.#N/A

Like VLOOKUP, MATCH looks for an approximate match unless you say otherwise: its third argument defaults to 1, so a code that isn’t on the list returns 5, the stapler’s position. Add the 0 every time. XLOOKUP does the same job in one function with an exact match by default, so where everyone has Excel 2021 or later it’s the shorter formula. Keep INDEX and MATCH for workbooks that older versions open.

Which one to use

  • Use XLOOKUP when everyone who opens the workbook has Microsoft 365, Excel 2021 or later, or Excel for the web. Microsoft’s own VLOOKUP page suggests it.
  • Use VLOOKUP with FALSE, or INDEX and MATCH, when the workbook goes to someone on Excel 2019 or earlier. Those versions don’t have XLOOKUP: the formula shows _xlfn. in front of its name and calculates as #NAME?.
  • Leave a working VLOOKUP alone in an old workbook, and switch it when you next change the table.
  • Learn both for a job test. A test built on an older version of Excel expects VLOOKUP. Our guide to Excel assessment tests has a practice test with answers.
  • In Google Sheets, either works. Google added XLOOKUP to Sheets in August 2022.

How to turn a VLOOKUP into an XLOOKUP

  1. Keep the first argument. The value to look for doesn’t change.
  2. Make the second argument the column VLOOKUP searches: the first column of its table. In A2:D7, that’s A2:A7.
  3. Make the third argument the column VLOOKUP returns. Count across the table to its column number: in A2:D7, column 4 is D2:D7.
  4. Drop FALSE. XLOOKUP matches exactly by default. If the VLOOKUP had TRUE, or no fourth argument, add -1 as the match mode to keep the approximate match.
  5. Move any message into the fourth argument. If the VLOOKUP sat inside IFNA or IFERROR, its message becomes XLOOKUP’s fourth argument.
VLOOKUPXLOOKUPResult
=VLOOKUP("NB-2041",A2:D7,4,FALSE)=XLOOKUP("NB-2041",A2:A7,D2:D7)85
=VLOOKUP(3.2,A2:B5,2,TRUE)=XLOOKUP(3.2,A2:A5,B2:B5,,-1)4.50
=IFNA(VLOOKUP("ST-3320",A2:D7,3,FALSE),"Not found")=XLOOKUP("ST-3320",A2:A7,C2:C7,"Not found")Not found

The second pair runs on the delivery rates above. Lock the ranges with $ before you fill an XLOOKUP down, as you would with VLOOKUP.

XLOOKUP and VLOOKUP exercises with answers

These 7 exercises run on one table. Some ask for XLOOKUP and some for VLOOKUP, and every answer shows a formula for the other function, or for INDEX and MATCH where VLOOKUP can’t do the job. Download the workbook to do them in Excel, or type the table in yourself, starting in cell A1.

Download the practice workbook

Excel file, 8 KB. It opens in Google Sheets too.

Eight sales staff with their ID, team and sales, and the bonus bands in G1:H4. The cells below the list hold the values to look up, and the yellow cells show where each answer goes.

The table for exercises 1 to 7
ABCDEFGH
1IDNameTeamSalesBonus rateSales fromRate
21041AshaNorth18,500 (your answer goes here)02%
31042BenSouth9,200 (your answer goes here)10,0003%
41043ChenNorth24,750 (your answer goes here)20,0005%
51044DanaEast12,300 (your answer goes here)
61045EliSouth7,800 (your answer goes here)
71046FemiEast21,400 (your answer goes here)
81047GraceNorth15,050 (your answer goes here)
91048HugoSouth10,000 (your answer goes here)
10
11ID1046
12Name (your answer goes here)
13Sales (your answer goes here)
14
15NameGrace
16ID (your answer goes here)
17
18ID1050
19Team (your answer goes here)
20
21Top seller (your answer goes here)
22Same team (your answer goes here)
  1. In B12, return the name for the ID in B11 with XLOOKUP.
  2. In B13, return the sales for the same ID with VLOOKUP.
  3. In B16, return the ID for the name in B15. The IDs are to the left of the names.
  4. B18 holds an ID that isn’t on the list. In B19, return the team, or Not on the list when there’s no match.
  5. In E2, look up Asha’s bonus rate in G2:H4 from her sales: 2% from 0, 3% from 10,000 and 5% from 20,000. Lock the bands, then fill down to E9.
  6. In B21, return the name of the person with the highest sales.
  7. In B22, count the people in the same team as the ID in B11.

Answers to exercises 1 to 7

ExerciseFormulaHow it worksResult
1=XLOOKUP(B11,A2:A9,B2:B9)XLOOKUP searches the IDs in A2:A9 and returns the name from the same row of B2:B9. Also works: =VLOOKUP(B11,A2:D9,2,FALSE).Femi
2=VLOOKUP(B11,A2:D9,4,FALSE)Sales is the 4th column of A2:D9. Without FALSE, an ID that isn’t on the list would return the sales of the ID before it. Also works: =XLOOKUP(B11,A2:A9,D2:D9).21,400
3=XLOOKUP(B15,B2:B9,A2:A9)XLOOKUP searches the names and returns the ID from their left. VLOOKUP can’t: it only searches the first column of its table. Also works: =INDEX(A2:A9,MATCH(B15,B2:B9,0)).1047
4=XLOOKUP(B18,A2:A9,C2:C9,"Not on the list")The fourth argument is what XLOOKUP shows when nothing matches. For VLOOKUP, wrap it in IFNA. Also works: =IFNA(VLOOKUP(B18,A2:D9,3,FALSE),"Not on the list").Not on the list
5=XLOOKUP(D2,$G$2:$G$4,$H$2:$H$4,,-1)Match mode -1 takes the band at or below each figure, so Hugo’s 10,000 gets 3%. VLOOKUP with TRUE does the same, as long as the bands are sorted smallest first. Also works: =VLOOKUP(D2,$G$2:$H$4,2,TRUE).3%, 2%, 5%, 3%, 2%, 5%, 3%, 3%
6=XLOOKUP(MAX(D2:D9),D2:D9,B2:B9)MAX finds the highest sales, and XLOOKUP returns the name from the same row, to the left. Also works: =INDEX(B2:B9,MATCH(MAX(D2:D9),D2:D9,0)).Chen
7=COUNTIF(C2:C9,XLOOKUP(B11,A2:A9,C2:C9))XLOOKUP returns Femi’s team, and COUNTIF counts that team in C2:C9. A lookup can feed any function that takes a value. Also works: =COUNTIF(C2:C9,VLOOKUP(B11,A2:D9,3,FALSE)).2

One more to try in your browser. It’s VLOOKUP practice from lesson 30 of Excel Foundations.

In C2, use VLOOKUP to find the price for the code in A2.

Example data for this task
ABCDEFGH
1CodeQtyPriceCodeProductPrice
2ST-33024 (your answer goes here)NB-2041Notebook3.50
3NB-204110PN-1180Pens4.20
4FD-100530ST-3302Stapler9.99
5DL-44101DL-4410Desk lamp24.00
6FD-1005Folders1.80

Create a free account to practise every lookup in Excel Foundations.

Questions

Is XLOOKUP better than VLOOKUP?

For most lookups, yes. XLOOKUP matches exactly by default, can return a column to the left or several columns at once, and keeps working when someone inserts a column. VLOOKUP’s advantage is that every version of Excel has it.

Can I use XLOOKUP in Excel 2016 or Excel 2019?

No. Microsoft says XLOOKUP isn’t available in Excel 2016 and Excel 2019. Open a workbook that uses it in one of those versions and the formula shows _xlfn. in front of XLOOKUP and calculates as #NAME?. Use VLOOKUP with FALSE, or INDEX and MATCH, instead.

What are the downsides of XLOOKUP?

The main one is versions: Excel 2019 and earlier don’t have it, so its formulas show #NAME? for anyone using them. It also has more optional arguments to learn, and its match and search modes are numbers, such as -1 and 2, rather than TRUE or FALSE.

When was XLOOKUP introduced?

Microsoft announced XLOOKUP on 28 August 2019, for Office Insiders. By the end of March 2020 it had reached every Office 365 subscriber on the Monthly Channel, and Excel 2021 was the first version you buy outright that has it. VLOOKUP has been in Excel since the first version, Excel 1 for the Mac, in 1985.

Does anyone still use VLOOKUP?

Yes. Every version of Excel has it, so older workbooks are full of it, and a file for someone on Excel 2019 or earlier still needs it. Excel tests for jobs often check it too, so it’s worth knowing both.

Does XLOOKUP work in Google Sheets?

Yes. Google added XLOOKUP to Sheets in August 2022, with the same six arguments, and VLOOKUP works there too.

How do I use XLOOKUP with two conditions?

Multiply two tests to make the lookup range, and look for 1: =XLOOKUP(1,(A2:A9=F1)*(B2:B9=G1),C2:C9) returns the value from column C on the first row where A matches F1 and B matches G1. Joining the columns works too: =XLOOKUP(F1&G1,A2:A9&B2:B9,C2:C9). VLOOKUP needs a helper column that joins the two columns first.

Keep practising

Excel Foundations, our free course, teaches XLOOKUP, what to do when there’s no match, and VLOOKUP in its last module, after SUM, the $ sign, IF, COUNTIF and SUMIF. It has 30 short lessons and 82 exercises in a live sheet, and passing its test earns a certificate of completion.

See what’s in Excel Foundations

INDEX and MATCH, FILTER and two-way lookups come next, in Excel Intermediate, which comes with Pro. Each function has its own guide with a task to try: XLOOKUP and VLOOKUP. For more practice, try our Excel exercises with answers.

Start with Excel Foundations. It’s free.

Pro is $19 a month or $99 a year for every other track, with SQL included as it launches.

Create free account Go to your lessons