Lookup & Reference Excel 2021 ◉ 23 views

=XMATCH()

The XMATCH function searches for a specified item in an array or range of cells, and then returns the relative position of the first match.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for Mac
=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
Hover argument names in the table for details.
Output typeNumber
Popularity70 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =XMATCH() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
Download XMATCH.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
lookup_value Any type Required The lookup value
lookup_array Range Required The array or range to search
match_mode] Number Optional Specify the match type:0 - Exact match (default)-1 - Exact match or next smallest item1 - Exact match or next largest item2 - A wildcard match where *, ?, and ~ have special meaning.
search_mode] Range Optional Specify the search type:1 - Search first-to-last (default)-1 - Search last-to-first (reverse search).2 - Perform a binary search that relies on lookup_array being sorted in ascending order. If not sorted, invalid results will be returned.-2 - Perform a binary search that relies on lookup_array being sorted in descending order. If not sorted, invalid results will be returned.

▣ Examples

Example 1 =XMATCH(F2,C3:C9,1)
Example 2 =INDEX(C6:E12,XMATCH(B3,B6:B12),XMATCH(C3,C5:E5))
Example 3 =XMATCH(4,{5,4,3,2,1})
Example 4 =XMATCH(4.5,{5,4,3,2,1},1)

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.