Key Takeaways:
XLOOKUPreplacesVLOOKUP,HLOOKUP, and mostINDEX/MATCHformulas with one readable function available in Excel 365, Excel 2021/2024, and Excel for the Web.- Unlike
VLOOKUP, XLOOKUP defaults to an exact match, searches both left and right, survives inserted columns, returns entire rows or multiple columns at once, and includes a built-inif_not_foundfallback.- Need syntax reference or interactive help? Explore our XLOOKUP function reference, step-by-step XLOOKUP tutorial, or upload your workbook to ExcelGPT ChatExcel Studio.
For decades, Excel users relied on VLOOKUP to pull data between tables—and wrestled with its fragile column index numbers, right-only search restriction, and surprise approximate matches. Microsoft introduced XLOOKUP to fix every single one of those pain points in one modern, dynamic-array function.
In this complete guide, you will learn every argument of XLOOKUP, walk through eight practical business formulas you can copy straight into your spreadsheets, compare XLOOKUP side by side with VLOOKUP and INDEX MATCH, and troubleshoot common errors before they break your reports.
XLOOKUP Syntax and Arguments Explained
The full syntax of XLOOKUP has three required arguments and three optional arguments that unlock fallback messages, approximate tiers, wildcards, and reverse search:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
| Argument | Required? | What It Controls | Default Behavior |
|---|---|---|---|
lookup_value | Required | The value, cell reference, or expression you want to find (e.g., SKU, email, or employee ID). | None |
lookup_array | Required | The single row or single column range where Excel searches for lookup_value. | None |
return_array | Required | The range containing the result(s) to pull back; can be one column or multiple adjacent columns. | None |
[if_not_found] | Optional | Custom text, number, or formula returned when no match exists (replaces wrapping in IFERROR). | Returns #N/A |
[match_mode] | Optional | 0 = exact match; -1 = exact or next smaller; 1 = exact or next larger; 2 = wildcard match (*, ?, ~). | 0 (exact match) |
[search_mode] | Optional | 1 = first-to-last; -1 = last-to-first (latest record); 2 / -2 = binary search on sorted data. | 1 (top-to-bottom) |
Notice the biggest safety upgrade right away: because lookup_array and return_array are passed as separate ranges, inserting or deleting columns anywhere between them will never break your formula.
Basic XLOOKUP Example (and Custom Not-Found Fallback)
Suppose your Products sheet stores Product SKUs in column A, Product Names in column B, and Unit Prices in column D. On your Orders sheet, cell A2 holds a SKU and you want to return its Unit Price—displaying "SKU Missing" instead of an ugly #N/A error if a code is outdated:
=XLOOKUP(A2, Products!$A$2:$A$500, Products!$D$2:$D$500, "SKU Missing")
Even better, convert your lookup range into an Excel Table (Ctrl+T) named tblProducts so new rows expand automatically without updating fixed cell ranges:
=XLOOKUP(A2, tblProducts[SKU], tblProducts[UnitPrice], "SKU Missing")
If you are still getting comfortable with locking ranges with dollar signs like $A$2:$A$500, read our walkthrough on relative vs. absolute cell references.

6 Real-World XLOOKUP Patterns You Will Use Every Week
1. Left Lookup (Impossible with VLOOKUP)
When the identifier you know sits to the right of the value you want to retrieve—for example, looking up an email address in column E to pull the Customer ID from column A—simply point lookup_array to column E and return_array to column A:
=XLOOKUP(H2, Customers!$E$2:$E$1000, Customers!$A$2:$A$1000, "Not Found")
2. Returning Multiple Columns with One Dynamic Formula
Instead of writing three separate formulas for Customer Name, Region, and Account Manager, pass a multi-column return_array. Excel automatically spills all three columns across adjacent cells:
=XLOOKUP(A2, Customers!$A$2:$A$1000, Customers!$B$2:$D$1000, "Not Found")
Keep the cells to the right empty so Excel can spill cleanly; otherwise you will trigger a #SPILL! error.
3. Pulling the Latest Transaction (Reverse Search Mode)
Standard lookups always stop at the first match from the top. When a chronological price log or invoice ledger has repeated SKUs and you need the most recent price at the bottom of the table, set search_mode to -1:
=XLOOKUP(A2, PriceLog!$B$2:$B$2000, PriceLog!$D$2:$D$2000, "No History", 0, -1)
4. Tiered Discounts and Tax Brackets (Approximate Match)
For commission tiers or volume discounts where an order total of $7,500 falls inside the $5,000 tier, pass -1 for match_mode (exact match or next smaller item). Unlike VLOOKUP, your tier table does not even have to be sorted ascending:
=XLOOKUP(C2, DiscountTiers!$A$2:$A$6, DiscountTiers!$B$2:$B$6, 0, -1)
5. Partial Text Matching with Wildcards
When you only know part of a vendor name or product code (say, cell F2 contains "Pro" and you want the first SKU containing that word), set match_mode to 2:
=XLOOKUP("*"&F2&"*", Products!$B$2:$B$500, Products!$C$2:$C$500, "No Match", 2)
6. Multi-Criteria Lookup and Two-Way Matrix Lookup
Need to match both Region (G2) and Product (H2) at the same time? Concatenate the lookup values and arrays using & (or use boolean multiplication (Range1=Val1)*(Range2=Val2) to search for 1):
=XLOOKUP(1, (Sales!$A$2:$A$500=G2)*(Sales!$B$2:$B$500=H2), Sales!$E$2:$E$500, 0)
For a two-way grid where rows are Products and columns are Months (B1:M1), nest one XLOOKUP inside another so the inner lookup returns the entire matching month column:
=XLOOKUP(P2, $A$2:$A$50, XLOOKUP(Q2, $B$1:$M$1, $B$2:$M$50), "Check Inputs")
XLOOKUP vs. VLOOKUP vs. INDEX MATCH
| Capability | XLOOKUP | VLOOKUP | INDEX + MATCH |
|---|---|---|---|
| Default match mode | Exact match (safe) | Approximate (error-prone) | Requires 0 in MATCH |
| Look left of lookup column | Yes | No | Yes |
| Survives inserted/deleted columns | Yes | No (breaks index number) | Yes |
Built-in if_not_found fallback | Yes | Requires IFERROR | Requires IFERROR |
| Return multiple columns at once | Yes (dynamic spill) | Requires helper array/copies | Complex |
| Reverse bottom-to-top search | Yes (search_mode = -1) | No | Requires helper/MAX |
| Works in Excel 2016 / 2019 | No (requires 365 / 2021+) | Yes | Yes |
Rule of thumb: Use XLOOKUP for every new workbook shared among Excel 365, Excel 2021/2024, or Excel for the Web users. Only stick with INDEX/MATCH when external clients still open your file on Excel 2016 or 2019.
Common XLOOKUP Errors and How to Fix Them
#VALUE!error: Almost always caused by mismatched range lengths—for example,lookup_arraycoversA2:A500whilereturn_arraycoversC2:C501. Make both dimensions identical or use structured Excel Table columns.#SPILL!error: Your multi-columnreturn_arrayhit non-empty cells or sits inside an Excel Table (Excel Tables do not allow dynamic spill formulas). Clear the blocking cells or return one column per table column.#NAME?error: Usually a typo in the function name or opening the workbook in an older legacy version (Excel 2019 or earlier) that does not supportXLOOKUP.- Unexpected
if_not_found/#N/A: Check for trailing spaces withTRIM()and ensure numbers stored as text are converted consistently. See our complete Excel formula errors troubleshooting guide for fast diagnostics.
Build and Audit XLOOKUP Workflows Automatically with ChatExcel
Writing one lookup is straightforward; reconciling five multi-sheet exports with inconsistent IDs, trailing spaces, and multi-criteria joins is where errors creep in. With ExcelGPT ChatExcel Studio, you can upload your actual Excel or CSV files and describe the join in plain language—ChatExcel cleans keys deterministically, verifies matches across sheets, and exports ready-to-audit workbooks.
- Instant formula generation & repair: Use the AI Excel Formula Generator for custom nested XLOOKUP syntax or paste a broken formula into the AI Formula Fixer.
- Further reading: Review Microsoft's official XLOOKUP documentation, compare with VLOOKUP syntax, or try our XLOOKUP step-by-step tutorial.
Frequently Asked Questions
Is XLOOKUP better than VLOOKUP?
Yes. XLOOKUP defaults to exact matching, looks both left and right, never breaks when columns are inserted, supports reverse searches from the bottom of a table, and handles missing values natively without wrapping the formula in IFERROR.
Can XLOOKUP return multiple matches for the same lookup value?
No—XLOOKUP returns a single matching row (either the first match with search_mode = 1 or the last match with search_mode = -1). To return all rows matching a criterion, use Excel's FILTER function instead.
Does XLOOKUP work across different worksheets and workbooks?
Yes, XLOOKUP works across sheets in the same workbook and across separate open workbooks. However, unlike VLOOKUP, XLOOKUP returns a #VALUE! error if an external referenced workbook is closed—keep linked files open or consolidate tables with Power Query.
Is XLOOKUP case-sensitive?
By default, XLOOKUP is not case-sensitive ("abc" matches "ABC"). For a case-sensitive lookup, pair it with EXACT: =XLOOKUP(TRUE, EXACT(A2, $D$2:$D$100), $E$2:$E$100).
Which Excel versions support XLOOKUP?
XLOOKUP is available in Microsoft 365 (Windows and Mac), Excel 2021, Excel 2024, Excel for the Web, and Google Sheets. Users on Excel 2016 or Excel 2019 should use INDEX and MATCH for backward compatibility.
Put this guide into practice
Run this workflow on your own spreadsheet in seconds
Upload an Excel or CSV file to generate formulas, clean messy columns, build charts, and audit results with verifiable cell changes.



