Your cart is currently empty!
Master the XMATCH Function in Excel 365
📘 What is the XMATCH
Function in Excel?
The XMATCH
function is a modern alternative to MATCH
, introduced in Excel 365 and Excel 2021. It returns the relative position of an item in a row or column. Unlike MATCH
, it supports reverse search, wildcard matching, and exact or approximate search modes.
🔧 Syntax of XMATCH
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
Parameter | Description |
---|---|
lookup_value | The value you want to search for |
lookup_array | The range or array to search in |
match_mode | (Optional) 0 = exact (default), -1 = exact or next smaller, 1 = exact or next larger, 2 = wildcard match |
search_mode | (Optional) 1 = first-to-last (default), -1 = last-to-first, 2 = binary ascending, -2 = binary descending |
✅ Key Features of XMATCH
- Supports vertical and horizontal lookups
- Can search from last to first (
search_mode = -1
) - Allows wildcard characters (
match_mode = 2
) - Works with arrays and spilled ranges
- Better compatibility with dynamic arrays
🧪 Examples
🔹 Example 1: Basic Exact Match
=XMATCH("Priya", A2:A10)
Searches for “Priya” in the list and returns the position where it’s found.
✅ If “Priya” is in cell A5 (4th position in A2:A10), the result is 4
.
🔹 Example 2: Wildcard Match
=XMATCH("P*", A2:A10, 2)
Returns the first item starting with “P”.
✅ Useful for partial string lookups.
🔹 Example 3: Reverse Search
=XMATCH("Complete", A2:A10, 0, -1)
Searches bottom-up for “Complete”.
🔹 Example 4: Approximate Match
If you have numbers like 50, 60, 70, and you’re looking for 65
:
=XMATCH(65, A2:A10, 1)
Returns the position of the next larger number (70).
🔹 Example 5: Use with INDEX for Advanced Lookup
=INDEX(B2:B10, XMATCH("Ravi", A2:A10))
Finds Ravi in column A and returns corresponding value from column B.
✅ Powerful alternative to VLOOKUP
or INDEX+MATCH
.
🎓 Common Use Cases
- Find row/column numbers dynamically
- Combine with
INDEX
for 2D lookups - Reverse search to find last matching item
- Match using wildcards like
"*Report"
or"Jan???"
- Create dynamic dashboards or filters
❓ 5 Interview-Based Questions on XMATCH
- What is the key difference between
XMATCH
andMATCH
in Excel? (Expected: XMATCH supports reverse search, wildcards, exact/approximate modes, and works with dynamic arrays.) - How would you find the last occurrence of a value in a list using
XMATCH
? (Hint: Usesearch_mode = -1
) - What does the following formula return?
=XMATCH(75, A2:A6, -1)
(Expected: Returns the position of the largest number less than or equal to 75.) - Can
XMATCH
be used withINDEX
to replicate VLOOKUP? Provide an example. (Yes, e.g.,=INDEX(B2:B10, XMATCH("ItemName", A2:A10))
) - Explain how to use
XMATCH
for partial matches using wildcards. (Setmatch_mode = 2
, e.g.,=XMATCH("Jan*", A2:A10, 2)
)
📌 Final Thoughts
XMATCH
is more powerful and flexible than MATCH
and a great fit for modern Excel tasks involving dynamic lookups. If you’re preparing for interviews or building advanced dashboards, mastering XMATCH
can save time and simplify your logic.
🚀 Want to Master Excel 365 Lookups?
Enroll in my in-depth Excel training course covering:
XMATCH
,XLOOKUP
,INDEX-MATCH
,FILTER
,LET
,LAMBDA
- Dashboards, automation, case studies
👉 Mastering MS Excel – A Comprehensive Training Course
On sale products
-
Excel Course in Hindi: Basic to Advanced Level
Original price was: ₹2,299.00.₹2,249.00Current price is: ₹2,249.00. -
Excel Training Program: Fundamentals to Advanced Techniques : Classroom/ Live Classes
Original price was: ₹6,000.00.₹4,000.00Current price is: ₹4,000.00. -
Excel VBA/Macro Masterclass: Automate Excel, Boost Productivity : Classroom /Live Class Training
Original price was: ₹8,500.00.₹6,500.00Current price is: ₹6,500.00. -
Gmail Mastery Training in Hindi: Unlocking Advanced Email Management Technique
Original price was: ₹899.00.₹849.00Current price is: ₹849.00. -
Gmail Mastery: Advanced Training for Efficient Email Management
Original price was: ₹899.00.₹849.00Current price is: ₹849.00. -
Google Calendar Mastery Training: Learn to Streamline Your Schedule in Just 1 Hour
Original price was: ₹999.00.₹949.00Current price is: ₹949.00.