Advanced Excel for Data AnalystsLesson 25 of 49
Lesson 25 of 49

Modern Relational Lookups: XLOOKUP & XMATCH Masterclass

Overview & Learning Objectives

XLOOKUP is Microsoft's modern replacement for VLOOKUP, HLOOKUP, and LOOKUP. It defaults to exact match, searches in any direction, replaces IFNA with a built-in not-found fallback, and never breaks when columns are inserted.

  • Master the 6 parameters of XLOOKUP (3 mandatory, 3 optional).
  • Perform leftward lookups without INDEX & MATCH.
  • Use built-in [if_not_found] to eliminate ugly `#N/A` errors.
  • Deploy XMATCH for modern relative position lookups.

Industry Standard

Standard: Modern enterprise data teams have phased out legacy VLOOKUP in favor of XLOOKUP across all new financial models and production reporting workbooks.

Real-World Example: Flipkart Vendor Catalog & SKU Reconciliation

At Flipkart Seller Hub, catalog managers cross-reference SKU IDs to fetch Vendor Name (placed to the LEFT) and Wholesale Cost (placed to the RIGHT). A single XLOOKUP retrieves both directions cleanly.

Vendor Name (Left)SKU Code (Search)Product TitleWholesale Price (Right)
Alpha TradersSKU-7701Bluetooth Headphones1,450
Zephyr RetailSKU-7702Smart Watch Fit 22,800
Om InfotechSKU-7703USB-C Fast Cable220

Functions Covered in this Chapter

Here is the definition, exact syntax, parameter breakdown, and real-world business example for each function covered in this chapter:

Function 1

XLOOKUP Function

Definition: Searches a range or array for a match and returns the corresponding item from a second range or array. Defaults to exact match and can search right-to-left.

Syntax:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Parameters Breakdown:
  • lookup_value: The value to search for (e.g. "SKU-7701").
  • lookup_array: The column or row being searched (B2:B4).
  • return_array: The column or row to return values from (A2:A4 for left, D2:D4 for right).
  • [if_not_found]: Clean fallback text if no match exists (e.g. "SKU Not Found").
  • [match_mode]: 0=Exact match (default), -1=Exact or next smaller, 1=Exact or next larger, 2=Wildcard match.
  • [search_mode]: 1=Search first-to-last (default), -1=Search last-to-first (reverse search).
Real-World Example (Leftward Vendor Lookup):
Problem / Scenario: Find the Vendor Name (Col A) for "SKU-7702" (Col B).
Formula: =XLOOKUP("SKU-7702", B2:B4, A2:A4, "Not Found")
Result: "Zephyr Retail"
Why it works: XLOOKUP searches B2:B4 and retrieves the matching item from A2:A4 to the left effortlessly.
Function 2

XMATCH Function

Definition: The modern successor to MATCH. Returns the relative position of an item in an array, defaulting to exact match and supporting reverse order searches.

Syntax:
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
Parameters Breakdown:
  • lookup_value: The search target.
  • lookup_array: The 1D range to scan.
  • [match_mode]: 0 for exact match (default).
  • [search_mode]: 1 for first-to-last, -1 for last-to-first.
Real-World Example (Locate Row Position):
Problem / Scenario: Find the row position of "SKU-7703" in B2:B4.
Formula: =XMATCH("SKU-7703", B2:B4)
Result: 3
Why it works: Returns position 3 without requiring an explicit 0 for exact match.

Common Mistakes & Limitations

  • Using XLOOKUP in workbooks that must be opened by clients running Excel 2016 or earlier (XLOOKUP is only supported in Excel 2021, Excel 365, and Excel for Web).
  • Selecting ranges of different lengths for `lookup_array` and `return_array`, causing `#VALUE!` error.

Keyboard Shortcuts

ActionWindowsMac
Insert Function AssistantShift + F3Shift + F3
Select Contiguous Column RangeCtrl + Shift + Down ArrowCmd + Shift + Down Arrow

Pro Tips & Modern Alternatives

  • XLOOKUP can return multiple columns at once: `=XLOOKUP("SKU-7701", B2:B4, C2:D4)` spills both Title and Price simultaneously!
  • Use `INDEX & MATCH` if backward compatibility with legacy Excel 2013/2016 is required.