Cellgrids Cellgridsby LearnWithRinkesh
Home › Excel tutorials › XMATCH Function in Excel (Better than MATCH)

How to Use the XMATCH Function in Excel as a Better Version of MATCH

By Rinkesh Shah · Business Analyst, 8 years in data · Updated 2026-10-31

▶ Video coming soon

XMATCH does what MATCH does, with fewer traps. The default is an exact match, it can search from the bottom of a list, and it supports wildcards. It is available in Microsoft 365 and Excel 2021 or newer.

Syntax

=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])

Basic example

Names in A2:A100:

=XMATCH("Priya", A2:A100)

No need to type 0 at the end, as you must with MATCH.

Find the last time something appears

Set search_mode to -1 to search from the bottom:

=XMATCH("Priya", A2:A100, 0, -1)

This is the easy way to find the most recent entry for a customer in a log.

Wildcards

Use match_mode 2 to find the first name starting with Pri:

=XMATCH("Pri*", A2:A100, 2)

Use it with INDEX

=INDEX(C2:C100, XMATCH(F1, A2:A100))

This is the same idea as INDEX MATCH, just shorter and safer.

XMATCH or MATCH?

If everyone who opens the file has Microsoft 365 or Excel 2021 or newer, use XMATCH. If the file goes to someone with Excel 2016 or older, stay with MATCH.

Worked example

=XMATCH("Dev",A2:A6) returns 4 for the list Asha, Bina, Chetan, Dev, Esha. Unlike MATCH, the default is an exact match. =XMATCH("Dev",A2:A6,0,-1) searches from the bottom to find the last match.

Common mistakes

Frequently asked questions

XMATCH or MATCH?

XMATCH defaults to exact match and can search from the end. MATCH works in all versions.

Can XMATCH search from the bottom?

Yes. Use -1 as the search mode.

What does it return if not found?

#N/A.

Practice this online, free

Reading is only half of learning Excel. Cellgrids is a free place for online Excel practice: solve Excel formula exercises in a live spreadsheet, prepare for Excel interview questions, and work through business case studies built for data analytics and business analytics roles.

Practice these formulas: XMATCH, MATCH, INDEX.

Start Excel practice → Case studies