
Excel XLOOKUP Basics: A Standard Lookup Function Easier Than VLOOKUP
This guide covers Excel XLOOKUP basics from a beginner’s perspective. You can reproduce exact matches, approximate matches, wildcards, left lookups, and multiple criteria by copying and pasting the tables and formulas.
Quick Fix: 3-Minute Recipe
- Convert the source data to tables with Ctrl+T (PriceList, Items).
- Unit price:
=XLOOKUP([@Item], PriceList[Item], PriceList[Price], "Not found") - Amount:
=IFERROR([@Qty]*[@[Unit Price]], 0) - See the examples below for left lookups, approximate matches, and wildcards.
XLOOKUP Basics
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
- Supports both left and right lookups, includes built-in error handling, and is safe when columns are inserted
Sample Data
| Item | Name | Price | Tier |
|---|---|---|---|
| T001 | T-Shirt | 19000 | Basic |
| T002 | Polo | 25000 | Plus |
| B014 | Pants | 35000 | Basic |
| O010 | Jacket | 159000 | Pro |
| S201 | Shoes | 140000 | Pro |
| Item | Qty | Unit Price | Amount | Note |
|---|---|---|---|---|
| T001 | 2 | |||
| T002 | 1 | |||
| S201 | 1 | |||
| B014 | 3 | |||
| X999 | 1 |
Exact Match & Error Replacement
=XLOOKUP([@Item], PriceList[Item], PriceList[Price], "Not found")
=IFERROR([@Qty]*[@[Unit Price]], 0)
Left Lookup
=XLOOKUP("Pro", PriceList[Tier], PriceList[Name], "Not found")
Approximate Match
=XLOOKUP([@Qty], TierTable[MinQty], TierTable[UnitPrice], , -1)
Wildcards
=XLOOKUP("*Shirt*", PriceList[Name], PriceList[Item], "Not found", 2)
Multiple Criteria
=LET(
key, TEXT([@Date],"yyyy-mm-dd") & "|" & [@Item],
XLOOKUP(key,
TEXT(Sales[Date],"yyyy-mm-dd") & "|" & Sales[Item],
Sales[Price],
"Not found")
)
Alternatives, Precautions, and Checklist
- Use Ctrl+T tables and column-name references to stay safe when columns are inserted
- Approximate matches require the lookup column to be sorted
- For duplicate values, use search_mode=-1 to find the last value
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
| Frequent #N/A errors | Mismatch in spelling, spaces, or format | Use TRIM/CLEAN/standardization and if_not_found |
| Approximate match does not work correctly | Not sorted | Sort in ascending order and check match_mode |
| Formula breaks after inserting a column | Cell references or column numbers | Switch to table column-name references |
| Partial match fails | match_mode=0 | Change to match_mode=2 and use a *pattern* |
Conclusion
With these Excel XLOOKUP basics, you can perform lookups safely and simply. The next article covers advanced XLOOKUP techniques.