· Par ExcelWorkflow · Excel · 3 min de lecture

Excel XLOOKUP: 10 Practical Examples and Common Mistakes

Master Microsoft Excel's XLOOKUP function: left lookups, native error fallbacks, multi-column return spills, reverse search, approximate matching, and cross-version compatibility traps.

Excel XLOOKUP: 10 Practical Examples and Common Mistakes

Why XLOOKUP Rendered VLOOKUP Obsolete

For more than two decades, VLOOKUP was the cornerstone of corporate financial modeling. However, it was plagued by structural vulnerabilities:
- Inability to perform leftward lookups (lookup keys had to physically reside in column 1).
- Silent failure risk when columns were inserted into reference tables (static column index numbers shifting).
- Hazardous default configuration: approximate matching enabled by default unless ,FALSE was explicitly tagged.
- Mandatory nested wrappers like IFNA(VLOOKUP(...), "Not Found") to mask #N/A errors.

Introduced in Microsoft 365 and Excel 2021+, XLOOKUP resolves these architectural flaws while harnessing the modern dynamic array calculation engine.


XLOOKUP Formal Syntax Anatomy

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
  • lookup_value (Required): The key value to search for.
  • lookup_array (Required): The single-column or single-row range scanned for the key.
  • return_array (Required): The range (single or multi-column) returning matching records.
  • [if_not_found] (Optional): Fallback string returned when no match exists (eliminates IFERROR).
  • [match_mode] (Optional): 0 = Exact match (default), -1 = Exact or next smaller, 1 = Exact or next larger, 2 = Wildcard search.
  • [search_mode] (Optional): 1 = First-to-last (default), -1 = Last-to-first (reverse search).

10 Enterprise Practical Scenarios

Scenario 1: Basic Exact Match with Built-In Fallback

Eliminate unsightly error flags in executive presentations:

=XLOOKUP(E2, Customers[ID], Customers[Name], "Customer Not Found")

Scenario 2: Leftward Lookups Without INDEX/MATCH

When an employee badge ID sits in column D and you need the employee name in column A:

=XLOOKUP(F2, Employees[BadgeID], Employees[FirstName], "Unknown")

Scenario 3: Multi-Column Spill Array

Instead of authoring three repetitive lookups for Name, Department, and Salary:

=XLOOKUP(F2, Employees[BadgeID], Employees[[Name]:[Salary]], "Not Found")

The formula is committed in a single cell and spills dynamically into adjacent horizontal cells.


Scenario 4: Tiered Volume Discount (Approximate Match)

Match order quantity against discount price breaks (e.g., 0, 100, 500, 1,000 units):

=XLOOKUP(B2, DiscountTiers[MinUnits], DiscountTiers[Rate], 0, -1)

The -1 parameter ensures an order of 450 units matches against the 100-unit tier.


Find an account when you only know a partial fragment of the entity name:

=XLOOKUP("*" & E2 & "*", Customers[AccountName], Customers[Balance], "Not Found", 2)

Match mode 2 unlocks asterisk (*) and question mark (?) wildcard evaluations.


Scenario 6: Reverse Search (Isolating the Most Recent Transaction)

To retrieve the latest transaction date for a customer from an append-only transaction log:

=XLOOKUP(E2, Orders[CustomerID], Orders[OrderDate], "No Orders", 0, -1)

Search mode -1 in the 6th position scans bottom-up, instantly returning the latest entry.


Scenario 7: Two-Way Matrix Lookup (Row and Column Intersection)

Nest two XLOOKUP statements to pull the intersection of a product on rows and a month on columns:

=XLOOKUP(E2, PriceMatrix[Product], XLOOKUP(F2, PriceMatrix[#Headers], PriceMatrix))

Scenario 8: Multi-Criteria Lookup Without Helper Columns

Look up pricing matching both Product and Regional Territory simultaneously:

=XLOOKUP(1, (Sales[Product]=E2) * (Sales[Region]=F2), Sales[UnitPrice], "Not Found")

The boolean vector multiplication outputs 1 only where both conditions evaluate to TRUE.


Scenario 9: Dynamic Sorting and Ranking

Pairing XLOOKUP with dynamic array extraction:

=XLOOKUP(LARGE(Sales[Revenue], {1;2;3}), Sales[Revenue], Sales[SalesRep])

Scenario 10: Structured Table Structured References

=XLOOKUP([@ProductID], Catalog[ID], Catalog[Description], "Discontinued")

Using [@Field] syntax prevents formula misalignment when records are sorted or filtered.


5 Critical Mistakes to Avoid

  1. Legacy Version Incompatibility: If opened by a colleague on Excel 2016 or standalone Excel 2019, XLOOKUP renders as #NAME?.
  2. #SPILL! Collision Errors: In multi-column returns, if an adjacent cell contains any existing text or space, Excel aborts the spill. Clear target cells.
  3. Mismatched Range Dimensions: lookup_array and return_array must possess identical height or width, otherwise Excel raises #VALUE!.
  4. Delimiter Discrepancies: English formulas use commas (,), whereas French/German Excel uses semicolons (;).
  5. Type Mismatch (Number Stored as Text): If keys are integers in table A but strings in table B, XLOOKUP will not match. Wrap with VALUE() to standardize.

Master Excel, Power Query & Power BI

Discover our practical courses designed to automate spreadsheets, clean data without code, and build audit-ready dashboards.

View Courses →