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 differs | XLOOKUP | VLOOKUP |
|---|---|---|
| Excel versions | Microsoft 365, Excel 2021 or later, and Excel for the web | Every version |
| Default match | Exact | Approximate, unless you add FALSE as the last argument |
| Which column it returns | The range you give it | The column whose number you give it |
| A column to the left | Yes | No: it searches the first column and returns from the right |
| After you insert a column | Still returns the same column | Can return the wrong column, because the number stays the same |
| When nothing matches | Shows its fourth argument, or #N/A | Shows #N/A, so you wrap it in IFNA or IFERROR |
| Several columns at once | Yes: give it a wider return range | No: one formula for each column |
| The last match | Yes, with search mode -1 | No: always the first match |
| The next larger value | Yes, with match mode 1 | No: an approximate match takes the next smaller value, in a sorted table |
| Wildcards (* and ?) | With match mode 2 | Yes, with FALSE |
| Horizontal lookups | Yes: give it a row to search | No: 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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Code | Item | Price | Stock |
| 2 | DL-4410 | Desk lamp | 24.00 | 12 |
| 3 | FD-1005 | Folders | 1.80 | 140 |
| 4 | NB-2041 | Notebook | 3.50 | 85 |
| 5 | PN-1180 | Pens | 4.20 | 0 |
| 6 | ST-3302 | Stapler | 9.99 | 6 |
| 7 | TP-5120 | Tape | 2.25 | 40 |
To find the stapler’s price, both functions need the code to look for. After that they ask for different things.
| Formula | What it does | Result |
|---|---|---|
=XLOOKUP("ST-3302", | Searches the codes in A and returns the price from C. | 9.99 |
=VLOOKUP("ST-3302", | 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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Staff ID | S104 | ID | Name | Department | |
| 2 | Name | (your answer goes here) | S101 | Ola Mensah | Sales | |
| 3 | S102 | Priya Nair | Finance | |||
| 4 | S103 | Tom Becker | Sales | |||
| 5 | S104 | Lerato Dube | Operations | |||
| 6 | S105 | Marco Rossi | Finance | |||
| 7 | S106 | Aiko Sato | Operations |
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.
| Formula | What it does | Result |
|---|---|---|
=VLOOKUP("ST-3320", | 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", | With FALSE, a code that isn’t on the list gives #N/A. | #N/A |
=XLOOKUP("ST-3320", | 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.
| Formula | What it does | Result |
|---|---|---|
=XLOOKUP("Tape", | Searches the items in B and returns the code from A, to their left. | TP-5120 |
=INDEX(A2:A7, | 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.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Code | Item | Colour | Price | Stock |
| 2 | DL-4410 | Desk lamp | Black | 24.00 | 12 |
| 3 | FD-1005 | Folders | Blue | 1.80 | 140 |
| 4 | NB-2041 | Notebook | White | 3.50 | 85 |
| 5 | PN-1180 | Pens | Black | 4.20 | 0 |
| 6 | ST-3302 | Stapler | Grey | 9.99 | 6 |
| 7 | TP-5120 | Tape | Clear | 2.25 | 40 |
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.
| Formula | What it does | Result |
|---|---|---|
=VLOOKUP("ST-3302", | Excel widened the table to A2:E7, but the 3 now points at the Colour column. | Grey |
=XLOOKUP("ST-3302", | 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.
| Formula | What it does | Result |
|---|---|---|
=XLOOKUP("ST-3320", | The fourth argument is what to show when nothing matches. | Not found |
=IFNA(VLOOKUP("ST-3320", | IFNA replaces VLOOKUP’s #N/A with the message. | Not found |
=IFERROR(VLOOKUP("ST-3302", | 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", | 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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Staff ID | S107 | ID | Name | Department | |
| 2 | Name | (your answer goes here) | S101 | Ola Mensah | Sales | |
| 3 | S102 | Priya Nair | Finance | |||
| 4 | S103 | Tom Becker | Sales | |||
| 5 | S104 | Lerato Dube | Operations | |||
| 6 | S105 | Marco Rossi | Finance | |||
| 7 | S106 | Aiko Sato | Operations |
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.
| Formula | What it does | Result |
|---|---|---|
=XLOOKUP("ST-3302", | A return range two columns wide: the price and the stock spill into two cells. | 9.99 and 6 |
=VLOOKUP("ST-3302", | The price, from the 3rd column. | 9.99 |
=VLOOKUP("ST-3302", | 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 | B | C | |
|---|---|---|---|
| 1 | Date | Code | New price |
| 2 | 5 Jan 2026 | ST-3302 | 8.99 |
| 3 | 12 Jan 2026 | NB-2041 | 3.25 |
| 4 | 2 Feb 2026 | ST-3302 | 9.49 |
| 5 | 16 Mar 2026 | PN-1180 | 4.20 |
| 6 | 1 Apr 2026 | ST-3302 | 9.99 |
| 7 | 6 Apr 2026 | NB-2041 | 3.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.
| Formula | What it does | Result |
|---|---|---|
=VLOOKUP("ST-3302", | VLOOKUP returns the first match: the oldest price. | 8.99 |
=XLOOKUP("ST-3302", | Search mode -1 searches from the last row up, so XLOOKUP returns the latest price. | 9.99 |
=XLOOKUP("ST-3302", | 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.
| A | B | |
|---|---|---|
| 1 | Up to (kg) | Rate |
| 2 | 1 | 4.50 |
| 3 | 5 | 7.95 |
| 4 | 10 | 12.50 |
| 5 | 20 | 18.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.
| Formula | What it does | Result |
|---|---|---|
=XLOOKUP(3.2, | Match mode 1 takes an exact match or the next larger value: the up-to-5 kg band. | 7.95 |
=VLOOKUP(3.2, | 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.
| Formula | What it does | Result |
|---|---|---|
=INDEX(C2:C7, | MATCH finds the code’s position in A, and INDEX returns the price at that position in C. | 9.99 |
=MATCH("ST-3320", | No 0, so MATCH looks for an approximate match and returns the stapler’s position. | 5 |
=MATCH("ST-3320", | 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
- Keep the first argument. The value to look for doesn’t change.
- Make the second argument the column VLOOKUP searches: the first column of its table. In
A2:D7, that’sA2:A7. - Make the third argument the column VLOOKUP returns. Count across the table to its column number:
in
A2:D7, column 4 isD2:D7. - 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.
- Move any message into the fourth argument. If the VLOOKUP sat inside IFNA or IFERROR, its message becomes XLOOKUP’s fourth argument.
| VLOOKUP | XLOOKUP | Result |
|---|---|---|
=VLOOKUP("NB-2041", | =XLOOKUP("NB-2041", | 85 |
=VLOOKUP(3.2, | =XLOOKUP(3.2, | 4.50 |
=IFNA(VLOOKUP("ST-3320", | =XLOOKUP("ST-3320", | 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.
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.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | ID | Name | Team | Sales | Bonus rate | Sales from | Rate | |
| 2 | 1041 | Asha | North | 18,500 | (your answer goes here) | 0 | 2% | |
| 3 | 1042 | Ben | South | 9,200 | (your answer goes here) | 10,000 | 3% | |
| 4 | 1043 | Chen | North | 24,750 | (your answer goes here) | 20,000 | 5% | |
| 5 | 1044 | Dana | East | 12,300 | (your answer goes here) | |||
| 6 | 1045 | Eli | South | 7,800 | (your answer goes here) | |||
| 7 | 1046 | Femi | East | 21,400 | (your answer goes here) | |||
| 8 | 1047 | Grace | North | 15,050 | (your answer goes here) | |||
| 9 | 1048 | Hugo | South | 10,000 | (your answer goes here) | |||
| 10 | ||||||||
| 11 | ID | 1046 | ||||||
| 12 | Name | (your answer goes here) | ||||||
| 13 | Sales | (your answer goes here) | ||||||
| 14 | ||||||||
| 15 | Name | Grace | ||||||
| 16 | ID | (your answer goes here) | ||||||
| 17 | ||||||||
| 18 | ID | 1050 | ||||||
| 19 | Team | (your answer goes here) | ||||||
| 20 | ||||||||
| 21 | Top seller | (your answer goes here) | ||||||
| 22 | Same team | (your answer goes here) |
- In
B12, return the name for the ID inB11with XLOOKUP. - In
B13, return the sales for the same ID with VLOOKUP. - In
B16, return the ID for the name inB15. The IDs are to the left of the names. B18holds an ID that isn’t on the list. InB19, return the team, or Not on the list when there’s no match.- In
E2, look up Asha’s bonus rate inG2:H4from her sales: 2% from 0, 3% from 10,000 and 5% from 20,000. Lock the bands, then fill down toE9. - In
B21, return the name of the person with the highest sales. - In
B22, count the people in the same team as the ID inB11.
Answers to exercises 1 to 7
| Exercise | Formula | How it works | Result |
|---|---|---|---|
| 1 | =XLOOKUP(B11, | XLOOKUP searches the IDs in A2:A9 and returns the name from the same row of B2:B9. Also works: =VLOOKUP(B11,. | Femi |
| 2 | =VLOOKUP(B11, | 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,. | 21,400 |
| 3 | =XLOOKUP(B15, | 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,. | 1047 |
| 4 | =XLOOKUP(B18, | The fourth argument is what XLOOKUP shows when nothing matches. For VLOOKUP, wrap it in IFNA. Also works: =IFNA(VLOOKUP(B18,. | Not on the list |
| 5 | =XLOOKUP(D2, | 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,. | 3%, 2%, 5%, 3%, 2%, 5%, 3%, 3% |
| 6 | =XLOOKUP(MAX(D2:D9), | MAX finds the highest sales, and XLOOKUP returns the name from the same row, to the left. Also works: =INDEX(B2:B9,. | Chen |
| 7 | =COUNTIF(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,. | 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.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Code | Qty | Price | Code | Product | Price | ||
| 2 | ST-3302 | 4 | (your answer goes here) | NB-2041 | Notebook | 3.50 | ||
| 3 | NB-2041 | 10 | PN-1180 | Pens | 4.20 | |||
| 4 | FD-1005 | 30 | ST-3302 | Stapler | 9.99 | |||
| 5 | DL-4410 | 1 | DL-4410 | Desk lamp | 24.00 | |||
| 6 | FD-1005 | Folders | 1.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.