Practice file to follow along
The fastest way to learn XLOOKUP is to type it yourself. The practice file has five tasks. Next to each row there is a check cell that says "correct" or "not yet" as soon as you have entered a formula. No email address needed.
- XLOOKUP practice file with basics, look left, your own text, search from the bottom and a solution for Excel 2019
- Answers with every formula filled in, plus each formula written out the way you type it
All names and numbers in the file are invented example data. Tasks 1 to 4 need Microsoft 365, Excel 2024 or Excel 2021. Task 5 works in every version.
What does XLOOKUP do?
XLOOKUP searches for your value in a column you choose and returns the value from another column in the same row. Unlike VLOOKUP, the lookup column does not have to come first. You name the lookup column and the result column separately.
Typical tasks at work
- return the department or name for a staff number
- return the price for a product number from a price list
- find the last entry for a person in a long list
- show a note of your own when a number is missing
Syntax and how to write it
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
These are the argument names Excel shows while you type. For most tasks the first three are enough. In English Excel you separate the arguments with commas. German and French Excel use semicolons.
| Excel language | The same formula |
|---|---|
| English | =XLOOKUP(A5,$H$5:$H$12,$I$5:$I$12) |
| German | =XVERWEIS(A5;$H$5:$H$12;$I$5:$I$12) |
| French | =RECHERCHEX(A5;$H$5:$H$12;$I$5:$I$12) |
If you open the file in Excel set to another language, Excel shows the formula in that language on its own. You find every name in three languages in our Excel functions list.
The six arguments
| Argument | Required? | What you enter | Example |
|---|---|---|---|
| lookup_value | yes | the value you look for, usually a cell | A5 (staff number 2103) |
| lookup_array | yes | the column Excel searches | $H$5:$H$12 (staff numbers) |
| return_array | yes | the column with the result, as long as the lookup_array | $I$5:$I$12 (departments) |
| if_not_found | no | a text or value shown instead of #N/A | "not in the list" |
| match_mode | no | 0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcards | 0 |
| search_mode | no | 1 from the top (default), -1 from the bottom, 2 and -2 for sorted lists | -1 |
The lookup_array and the return_array need the same number of rows. Start both in the same row and end both in the same row and you are fine.
Step by step to get the department for a staff number
This is how you solve task 1 of the practice file. Staff numbers are on the left, and the staff list with name, staff number and department is on the right in G4:I12.
- Click cell B5, where the department should go.
- Type
=XLOOKUP(and click A5. That is the lookup_value. - Type a comma and select the staff numbers H5:H12. Press F4 (Windows) or type the dollar signs yourself to turn it into
$H$5:$H$12. - Type a comma, select the departments I5:I12, turn them into
$I$5:$I$12and close the bracket. - Press Enter. B5 now shows HR, the department of Leah Hoffman. Fill the formula down to B9. The check cells say "correct".
There is no match_mode here on purpose. XLOOKUP looks for an exact match by default. With VLOOKUP you have to add FALSE at the end for that.
Look to the left
VLOOKUP cannot do this. On the staff list the name sits to the left of the staff number. With XLOOKUP that does not matter, because you pick the return_array freely.
=XLOOKUP(A5,'Staff list'!$B$5:$B$12,'Staff list'!$A$5:$A$12)
Excel looks for the staff number in column B and returns the name from column A. You practice this in task 2, where the list is on its own sheet. While you type the lookup_array, just click the other sheet and Excel adds the sheet name. A sheet name with a space goes in single quotes.
Show your own text instead of #N/A
When XLOOKUP cannot find the value, it returns #N/A. The fourth argument lets you decide what appears instead.
=XLOOKUP(A5,'Staff list'!$B$5:$B$12,'Staff list'!$C$5:$C$12,"not in the list")
With VLOOKUP you need IFERROR around the whole formula for that. With XLOOKUP it is one argument, and other errors in the formula stay visible. You practice this in task 3.
Find the last entry by searching from the bottom
Many lists contain the same number several times, such as orders or workwear handed out. By default XLOOKUP returns the first match from the top. With search_mode -1 it searches from the bottom and returns the last one.
=XLOOKUP(A5,$E$5:$E$14,$G$5:$G$14,"",0,-1)
The empty "" and the 0 fill the fourth and fifth argument, so Excel reads the -1 as the search_mode. If the newest entries are at the bottom, this gives you the latest state. You practice this in task 4.
XLOOKUP with multiple criteria
If you need two lookup values, such as item and size, join them with the & sign into one lookup_value and join the two columns the same way into one lookup_array.
=XLOOKUP(A5&B5,$F$5:$F$12&$G$5:$G$12,$H$5:$H$12)
Excel joins item and size in every row and looks for that combination. You do not need a helper column as you would with VLOOKUP.
XLOOKUP vs VLOOKUP compared
| Point | VLOOKUP | XLOOKUP |
|---|---|---|
| Direction | searches only the first column, result to the right of it | searches any column, result to the left or right |
| Default | approximate when the last argument is missing | exact |
| Inserting a column | the column number then points to the wrong column | stays right, because you give ranges instead of a number |
| Not found | #N/A, own text only with IFERROR | own text in the fourth argument |
| Multiple criteria | only with a helper column | with & right in the formula |
| Search from the bottom | no | search_mode -1 |
| Version | every Excel version | Microsoft 365, Excel 2024, Excel 2021, Excel for the web |
| File for colleagues on Excel 2019 | works | the formula does not work there |
What we recommend for each case
- New files that only you or colleagues on Microsoft 365 use → XLOOKUP.
- Files for clients or colleagues on Excel 2019 or older → VLOOKUP, or INDEX with MATCH.
- Existing VLOOKUP formulas that are correct → leave them, rebuilding them gains you nothing.
Which Excel versions have XLOOKUP?
According to Microsoft, XLOOKUP is available in Microsoft 365, Excel 2024, Excel 2021 and Excel for the web, and on the Mac from Excel 2021. It is not available in Excel 2019 and Excel 2016. If someone opens your file there, the formula does not work.
For that case there is INDEX with MATCH. The pair also looks to the left and runs in every version.
=INDEX('Staff list'!$C$5:$C$12,MATCH(A5,'Staff list'!$B$5:$B$12,0))
MATCH finds the row of the staff number, INDEX returns the department from that row. The 0 at the end of MATCH means exact match. You practice this in task 5.
XLOOKUP not working and how to fix common errors
| What you see | Cause | Fix |
|---|---|---|
| #N/A | The value is not in the lookup_array. | Add your own text as the fourth argument, as in =XLOOKUP(A5,$H$5:$H$12,$I$5:$I$12,"not in the list") |
| #N/A although the number is in the list | One number is stored as text, the other as a number. | Turn the text number into a number, for example with the warning icon next to the cell. |
| #N/A because of spaces | A space at the end, often after an import. | Clean it with TRIM, as in =XLOOKUP(TRIM(A5),$H$5:$H$12,$I$5:$I$12) |
| #NAME? | XVERWEIS or RECHERCHEX typed in English Excel, or a typo in the name. | Type the English name XLOOKUP. |
| The formula does not work in an older Excel version | Excel 2019 and older do not have XLOOKUP. | Use INDEX with MATCH, see above. |
| Excel reports a problem with the formula | Semicolons from a German or French guide. | In English Excel, replace every semicolon between the arguments with a comma. |
| Results are wrong after filling down | The ranges move along as you drag the formula. | Lock both ranges with $. |
| The result spills into several cells or Excel shows an error | The return_array covers several columns, so XLOOKUP returns all of them. That fails if the cells to the right are not empty. | Select only the one result column, or leave room to the right. |
If your data comes from a CSV file, numbers are often stored as text. Our guide on how to open a CSV file in Excel shows how to stop that during the import. Every error value is explained in our guide to Excel errors.
Related functions
- VLOOKUP, the classic that runs in every version
- INDEX and MATCH, the pair for older Excel versions
- XMATCH returns only the position of a value
- FILTER shows every match instead of just one
You find all functions with their English, German and French names in the Excel functions list.
What to learn next
Once the practice file works, try XLOOKUP on a list of your own. You can practice formulas like this in our Excel exercises with instant feedback. The Excel test shows you where you stand.
Sources
Function and argument names, match and search modes, default behavior and versions from Microsoft's help pages, November 2026.
- Microsoft, XLOOKUP function
- Microsoft, VLOOKUP function
- Microsoft, XMATCH function
- Microsoft, INDEX function
- Microsoft, MATCH function