XLOOKUP in Excel helps you find an item in one column and return information from the matching row. Instead of searching a price list by eye, type an item code and let a formula retrieve its price.
This practice uses invented stationery prices in rupees. They are example data, not current shop prices. You can type the table yourself, so no download or paid template is required.
Check your Excel version first
Microsoft lists XLOOKUP for Microsoft 365, Excel for the web, Excel 2021 and Excel 2024. It is not available in Excel 2016 or Excel 2019. If your version lacks it, use the VLOOKUP example below. Source: Microsoft XLOOKUP documentation.
Build this small practice table
Open a blank worksheet. Put the headings in A1:C1 and the four items in rows 2 through 5. Leave columns D onward empty for the exercise.
| A: Item code | B: Item | C: Example price (Rs) |
|---|---|---|
| P101 | Notebook | 180 |
| P102 | Pen | 50 |
| P103 | Folder | 120 |
| P104 | Marker | 90 |
Put Find code in E1 and P103 in E2. Put Price in F1. In F2, enter:
=XLOOKUP(E2,$A$2:$A$5,$C$2:$C$5,"Not found")
The answer for this table is 120. Change E2 to P101 and check that the answer becomes 180. This is an exact-match lookup; you do not need to sort these four item codes.
Read the formula in plain language
E2 contains the code to find. A2:A5 contains the codes to search. C2:C5 contains the corresponding prices. The final text supplies a useful message when the code is absent. Dollar signs keep the practice ranges fixed if you copy the formula.
Try P999 in E2. The result should be Not found. Then change the return range from C2:C5 to B2:B5 and try P102: the result should now be Pen. Return to the price formula before continuing.
Use VLOOKUP in older Excel versions
For the same table, this formula retrieves the price:
=VLOOKUP(E2,$A$2:$C$5,3,FALSE)
VLOOKUP searches the first column of A2:C5 and returns column 3 of that range. FALSE requests an exact match. Keep it explicit: omitting the final argument uses approximate matching, which is not appropriate for this item-code exercise. Source: Microsoft VLOOKUP documentation.
Handle errors without hiding mistakes
To show a message when the older formula returns an error:
=IFERROR(VLOOKUP(E2,$A$2:$C$5,3,FALSE),"Check the code")
IFERROR catches more than a missing item. Check the underlying formula before adding it, so an incorrect reference is not silently disguised as a missing code. Source: Microsoft IFERROR documentation.
A quick practice challenge
Find the price of P104, then test a code absent from the table. Finally, change the example price of P104 to 95 and confirm that the lookup updates. If the result is unexpected, check for extra spaces in item codes and verify that both lookup ranges cover the same rows.
Next, try creating a chart in Excel or build a weekly study planner. Both are practical ways to continue learning with small tables.