XMATCH Function in Excel: MATCH With Better Defaults

⏱ 1 min readUpdated 28 September 2026

LookupLevel: IntermediateAvailable in: Excel 365 / 2021+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. Related functions

XMATCH returns the position of an item, defaulting to exact match, and can search from the end or use wildcards.

Syntax

=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
Argument What it means
match_mode 0 exact (default), −1/1 next smaller/larger, 2 wildcard.
search_mode 1 first-to-last, −1 last-to-first.

Examples

Example 1

=XMATCH("Mar", B1:M1)

Column position of March.

Example 2

=XMATCH(F2, A:A, 0, -1)

Position of the last occurrence.

MATCH · XLOOKUP · INDEX

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong