---
title: "XMATCH function in Excel: syntax and examples | PracticeExcel"
description: "How to use XMATCH in Excel 365 and Google Sheets: MATCH with safer defaults."
canonical_url: "https://practiceexcelonline.com/functions/xmatch"
locale: en
meta:
  "og:description": "How to use XMATCH in Excel 365 and Google Sheets: MATCH with safer defaults."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~WE1BVENIIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBYTUFUQ0ggaW4gRXhjZWwgMzY1IGFuZCBHb29nbGUgU2hlZXRzOiBNQVRDSCB3aXRoIHNhZmVyIGRlZmF1bHRzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~WE1BVENIKGxvb2t1cF92YWx1ZSwgbG9va3VwX2FycmF5LCBbbWF0Y2hfbW9kZV0sIFtzZWFyY2hfbW9kZV0p%2Cp_Ii9mdW5jdGlvbnMveG1hdGNoIg%2Cs_kO9iz4e_sk5FT1v4.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "XMATCH function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~WE1BVENIIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBYTUFUQ0ggaW4gRXhjZWwgMzY1IGFuZCBHb29nbGUgU2hlZXRzOiBNQVRDSCB3aXRoIHNhZmVyIGRlZmF1bHRzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~WE1BVENIKGxvb2t1cF92YWx1ZSwgbG9va3VwX2FycmF5LCBbbWF0Y2hfbW9kZV0sIFtzZWFyY2hfbW9kZV0p%2Cp_Ii9mdW5jdGlvbnMveG1hdGNoIg%2Cs_kO9iz4e_sk5FT1v4.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The XMATCH function**

Returns the position of a value in a range, like MATCH but with exact match as the default and search from the end.

=

XMATCH(

## **Syntax**

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

<dl><dt>**lookup_value **</dt>
<dd>The value to find.</dd>
<dt>**lookup_array **</dt>
<dd>The range to search.</dd>
<dt>**match_mode **(optional)</dt>
<dd>0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcards.</dd>
<dt>**search_mode **(optional)</dt>
<dd>1 first to last (default), -1 last to first.</dd></dl>

## **Examples**

D1`=XMATCH(<sup>1</sup>"Plum",<sup>2</sup>A2:A4)`

|  | A | B | C | D |
| --- | --- | --- | --- | --- |
| 1 | Fruit | Price |  | **3** |
| 2 | Apple | 4 |  | |
| 3 | Pear | 6 |  | |
| 4 | Plum | 5 |  | |

**In plain words:** Find the position of <sup>1</sup>Plum in <sup>2</sup>the fruit list in A2:A4.

D1=XMATCH(6,B2:B4)

|  | A | B | C | D |
| --- | --- | --- | --- | --- |
| 1 | Fruit | Price |  | **2** |
| 2 | Apple | 4 |  | |
| 3 | Pear | 6 |  | |
| 4 | Plum | 5 |  | |

## **Read the guide**

- [**VLOOKUP vs XLOOKUP vs INDEX MATCH: which lookup to use**](https://practiceexcelonline.com/learn/vlookup-vs-xlookup-vs-index-match)

## **Related functions**

- [**MATCH**](https://practiceexcelonline.com/functions/match)
- [**XLOOKUP**](https://practiceexcelonline.com/functions/xlookup)
- [**INDEX**](https://practiceexcelonline.com/functions/index)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/xmatch#webpage","@type":"WebPage","description":"How to use XMATCH in Excel 365 and Google Sheets: MATCH with safer defaults.","name":"XMATCH function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/xmatch","breadcrumb":{"@id":"https://practiceexcelonline.com/functions/xmatch#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/xmatch"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/xmatch#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"XMATCH function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/xmatch#article","description":"How to use XMATCH in Excel 365 and Google Sheets: MATCH with safer defaults.","headline":"XMATCH function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~WE1BVENIIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBYTUFUQ0ggaW4gRXhjZWwgMzY1IGFuZCBHb29nbGUgU2hlZXRzOiBNQVRDSCB3aXRoIHNhZmVyIGRlZmF1bHRzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~WE1BVENIKGxvb2t1cF92YWx1ZSwgbG9va3VwX2FycmF5LCBbbWF0Y2hfbW9kZV0sIFtzZWFyY2hfbW9kZV0p%2Cp_Ii9mdW5jdGlvbnMveG1hdGNoIg%2Cs_kO9iz4e_sk5FT1v4.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/xmatch#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/xmatch#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~WE1BVENIIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBYTUFUQ0ggaW4gRXhjZWwgMzY1IGFuZCBHb29nbGUgU2hlZXRzOiBNQVRDSCB3aXRoIHNhZmVyIGRlZmF1bHRzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~WE1BVENIKGxvb2t1cF92YWx1ZSwgbG9va3VwX2FycmF5LCBbbWF0Y2hfbW9kZV0sIFtzZWFyY2hfbW9kZV0p%2Cp_Ii9mdW5jdGlvbnMveG1hdGNoIg%2Cs_kO9iz4e_sk5FT1v4.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~WE1BVENIIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBYTUFUQ0ggaW4gRXhjZWwgMzY1IGFuZCBHb29nbGUgU2hlZXRzOiBNQVRDSCB3aXRoIHNhZmVyIGRlZmF1bHRzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~WE1BVENIKGxvb2t1cF92YWx1ZSwgbG9va3VwX2FycmF5LCBbbWF0Y2hfbW9kZV0sIFtzZWFyY2hfbW9kZV0p%2Cp_Ii9mdW5jdGlvbnMveG1hdGNoIg%2Cs_kO9iz4e_sk5FT1v4.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
