How to Use XMATCH in Excel
XMATCH returns the position of a value in a range and improves on MATCH with cleaner exact matching, reverse search, and better flexibility. Here's how to use it.
Reviewed by Griddy
Updated for current Excel and Google Sheets workflows, with examples chosen to map back to real spreadsheet tasks rather than abstract formula syntax.
XMATCH returns the position of a value inside a range. It is the modern replacement for MATCH and is especially useful when you want cleaner exact matches, reverse search, or a lookup pattern that pairs well with INDEX.
That makes it useful in trackers, dashboards, and summary sheets where the formula needs to find a column or row position before returning the actual value.
The syntax
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])- lookup_value — the value you want to find
- lookup_array — the range Excel should search
- [match_mode] — optional;
0exact,-1exact or next smaller,1exact or next larger,2wildcard - [search_mode] — optional;
1first to last,-1last to first
For most uses, exact match is the safest pattern:
=XMATCH("Blocked", B1:F1, 0)Basic example with INDEX
If row 1 contains project summary headers and row 2 contains the values, you can return the value under a specific header like this:
=INDEX(B2:F2, XMATCH("Owner", B1:F1, 0))XMATCH finds the position of Owner in the header row, and INDEX returns the value from that same position in row 2.
That is a flexible pattern in project summary blocks where the column order may shift over time.
Search from last to first
One of XMATCH's useful upgrades is reverse search.
If column C contains task status and you want the position of the last Done entry:
=XMATCH("Done", C2:C100, 0, -1)This can be useful when you want the most recent matching milestone instead of the first one.
XMATCH vs MATCH
| MATCH | XMATCH | |
|---|---|---|
| Modern exact-match default | Less clear | Clearer |
| Reverse search | No | Yes |
| More flexible matching options | Limited | Better |
| Best for newer Excel workbooks | Okay | Better |
MATCH still works. XMATCH is usually easier to reason about in newer Excel environments.
When XMATCH is better than XLOOKUP
Use XLOOKUP when you want the returned value directly.
Use XMATCH when you specifically need the position first, often because:
- you are pairing it with INDEX
- you are locating a dynamic column
- you need the last matching position
That is why XMATCH fits better in some dashboard and tracker formulas than XLOOKUP does.
Common XMATCH mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Omitting exact match when it matters | Approximate logic can surprise you | Use 0 for exact matching |
| Confusing position with returned value | Formula returns a number instead of the wanted data | Pair XMATCH with INDEX when you need the value |
| Searching the wrong range shape | Position is meaningless or wrong | Make sure the lookup array is the exact row or column you intend |
| Using XMATCH in older Excel versions | #NAME? | Use a modern Excel version or fall back to MATCH |
→ NOTE
If the workbook must work in older Excel versions, MATCH is still the safer compatibility choice.
Where XMATCH fits best
XMATCH is strongest in workbooks where the sheet structure changes over time but the formula still needs to find the right field reliably.
That is common in:
The Griddy way
XMATCH is not hard once you understand it, but remembering when you want a position versus a returned value is where people usually get tripped up.
"Find the position of the Blocked column in this tracker header, then return the matching value from the summary row"
Griddy can structure the INDEX + XMATCH pattern around your real headers without making you debug the lookup logic manually.
Skip the manual work
Describe it. Griddy does it.
Instead of writing this formula yourself, just tell Griddy what you need in plain English. Works in Excel and Google Sheets.
Use this on real templates
Use position-based lookups in dynamic planning sheets
XMATCH is useful when trackers and summary views need to locate headers or the last matching item without relying on fragile hard-coded positions.
Project Tracker
Track tasks, owners, priorities, due dates, and blockers in one delivery board. Group work by stream, review progress, and keep next steps visible.
Project Tracker for Marketing Teams
Track campaign work, owners, deadlines, approvals, and blockers in one free marketing project tracker spreadsheet for Excel and Google Sheets.
Project Tracker for Client Work
Track client deliverables, owners, due dates, approvals, and blockers in one free project tracker spreadsheet built for service teams.

Gantt Chart
Plan project phases, owners, and milestones on a 12-week timeline. Colour-coded bars make schedules easy to scan in Excel, Google Sheets, or Griddy.

Gantt Chart for Product Launches
Plan launch milestones, owners, dependencies, and timing in one free Gantt chart spreadsheet built for product launches and release work.

Gantt Chart for Agencies
Plan agency timelines, client phases, approvals, and launch milestones in one free Gantt chart spreadsheet for service delivery teams.
OKR Tracker
Track company and team OKRs in one quarterly scorecard. Keep objective scores, KR progress, and leadership notes visible without needing dedicated OKR software.
OKR Tracker for Startups
Track startup objectives, key results, owners, progress, and confidence in one free OKR spreadsheet built for quarterly planning and review.