XLOOKUP in Excel: explained simply
You have an order list with item numbers and need the price for each one. The prices sit in a second table. XLOOKUP fetches them automatically. Here you see what goes into the formula, what to select and how to enter it step by step.
=XLOOKUP(H2, A2:A11, D2:D11)XLOOKUP asks: what am I looking for, where do I look, and what should come back? Put those three answers, separated by commas, inside the brackets.
What stands for what?
The formula has three parts. Each part is a question you answer with one click or one selection.
One single cell. Here the item number you want the price for: H2.
You click the cell once.
One column in the other table that holds all item numbers: A2:A11.
You select the column from the first to the last number, without the header.
The column with the answer, here the prices: D2:D11.
You select it the same way, from row 2 to row 11.
The use case: fetch the price for every item number
On the left is the master data with all items and prices, on the right the order list. Column J should show the price for each order. This is what it looks like in Excel; the colours show what you select:
| A | B | C | D | … | H | I | J | |
|---|---|---|---|---|---|---|---|---|
| 1 | Item no | Item | … | Price | Item no | Quantity | Price | |
| 2 | 1001 | Sunglasses Classic | … | 89.00 | 1005 | 12 | =XLOOKUP(H2,A2:A11,D2:D11) | |
| 3 | 1002 | Travel pillow | … | 24.90 | 1002 | 40 | ||
| 4 | 1003 | Perfume 50 ml | … | 64.00 | 1009 | 25 | ||
| 5 | 1004 | Chocolate 200 g | … | 7.50 | 1011 | 5 | ||
| … | … | … | … | … | ||||
| 11 | 1010 | Travel adapter | … | 19.90 |
Practice data to copy
Open a blank Excel workbook. Click “Copy data”, click the cell shown in Excel and press Ctrl+V.
| Item no | Item | Category | Price |
|---|---|---|---|
| 1001 | Sunglasses Classic | Accessories | 89.00 |
| 1002 | Travel pillow | Travel | 24.90 |
| 1003 | Perfume 50 ml | Fragrance | 64.00 |
| 1004 | Chocolate 200 g | Confectionery | 7.50 |
| 1005 | Headphones | Electronics | 129.00 |
| 1006 | Luggage tag | Travel | 9.90 |
| 1007 | Lip balm | Beauty | 12.50 |
| 1008 | Power bank | Electronics | 39.00 |
| 1009 | Pralines 250 g | Confectionery | 18.90 |
| 1010 | Travel adapter | Travel | 19.90 |
| Item no | Quantity | Price |
|---|---|---|
| 1005 | 12 | |
| 1002 | 40 | |
| 1009 | 25 | |
| 1011 | 5 | |
| 1001 | 8 | |
| 1008 | 60 | |
| 1004 | 120 |
Step by step: how to enter the formula
- Click cell J2. This is where the price should appear.
- Type
=XLOOKUP(Equals sign, function name, opening bracket. Excel now shows a small tooltip with the part that comes next. - Click cell H2 (item number 1005). Excel writes H2 into the formula. Then type a comma ,.
- Select A2 to A11: press the mouse on A2, hold, drag down to A11, let go. Press F4 to turn it into $A$2:$A$11. Type a comma.F4 adds the dollar signs. They lock the range when you drag the formula down later.
- Select D2 to D11, the prices. Press F4 again.
- Type
)and press Enter. J2 now shows 129.00, the price of the headphones. - Copy the formula to all rows: click J2 and double-click the small square at the bottom right of the cell. Excel fills the formula down to row 8.
Done. Your formula looks like this:
=XLOOKUP(H2,$A$2:$A$11,$D$2:$D$11)What your result looks like
1011 shows #N/A. That is correct: this number is not in the master data. The fix is just below.
| Item no | Quantity | Price |
|---|---|---|
| 1005 | 12 | 129.00 |
| 1002 | 40 | 24.90 |
| 1009 | 25 | 18.90 |
| 1011 | 5 | #N/A |
| 1001 | 8 | 89.00 |
| 1008 | 60 | 39.00 |
| 1004 | 120 | 7.50 |
Two extras once the basic formula works
Text instead of #N/A
Add a fourth part: the text to show for missing numbers. 1011 then shows “not found”.
=XLOOKUP(H2,$A$2:$A$11,$D$2:$D$11,"not found")Look to the left
Impossible with VLOOKUP, easy with XLOOKUP: look up the name in column B and return the number from column A. Result: 1010.
=XLOOKUP("Travel adapter",$B$2:$B$11,$A$2:$A$11)If it does not work
- #N/A – the number is not in column A. Often a stray space is the cause.
- #VALUE! – parts 2 and 3 have different lengths. Both must run from row 2 to row 11.
- Wrong prices after dragging down – the dollar signs are missing. Click the formula, select the range, press F4.
- #NAME? – your Excel version does not know XLOOKUP (Excel 2019 or older). Use VLOOKUP there.
Excel formulas your team actually uses
This exercise comes from our advanced Excel training. Your team works with XLOOKUP, pivot tables and charts on their own data, as corporate Excel training on site or live online. The next step: our post Excel dashboard with Copilot.
Deutsche Version: XVERWEIS in Excel ganz einfach erklärt · Next Excel tip: SUMIFS explained simply
XLOOKUP: frequently asked questions
Which Excel versions have XLOOKUP?
What is the difference to VLOOKUP?
Do I select the headers too?
Why commas and not semicolons?
Is XLOOKUP available in Google Sheets?
Microsoft and Excel are trademarks of the Microsoft group of companies; Google Sheets is a trademark of Google LLC. SkillDay is an independent training provider. The practice data is fictitious. For many more XLOOKUP examples, see Leila Gharani at xelplus.com.