formulastreak

MATCH vs XMATCH

Updated · Works in: Excel 2021+, Microsoft 365 · not Google Sheets (no XMATCH) · Every example checked before release

Short answer

MATCH(value, range, 0) returns a position in every Excel version and Google Sheets. XMATCH(value, range) defaults to exact match and can search from the end, but needs Excel 2021 or later and isn't in Google Sheets.

Use MATCH with 0 as its third argument if the file might be opened in Google Sheets or older Excel; use XMATCH in Excel 2021 or later when you need to search from the end. Both return where a value sits in a range: 1 for the first cell, 2 for the second. XMATCH defaults to an exact match; MATCH defaults to an approximate one.

MATCHXMATCH
Default matchApproximate (needs sorted data)Exact
Search from the last rowNoYes, search mode -1
ExcelEvery versionExcel 2021, 2024, Microsoft 365
Google SheetsYesNo

The same position, two ways

Where is “Ceramic pot” in the product list? MATCH(M1, H2:H8, 0) and XMATCH(M1, H2:H8) both return 5. The difference is the 0: MATCH needs it for an exact match, and XMATCH doesn't.

Orders and price list · edit M2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultM2 = 5
GHIJKLM
1SKUProductPriceStockProductCeramic pot
2PL-101Fern$9.5040Position5
3PL-104Monstera$34.0012
4PL-107Snake plant$22.0025
5PT-210Terracotta pot$12.5060
6PT-212Ceramic pot$19.0018
7TL-301Watering can$18.009
8SL-401Potting mix$7.2580

The last match: only XMATCH

Mara Okafor ordered twice. MATCH always finds the first: row 1 of the customer list. XMATCH with search mode -1 searches from the bottom: XMATCH(K1, C2:C13, 0, -1) returns 6, her latest order (the rows are in date order). Use the position with INDEX to fetch that order's details.

Leaf & Loam orders · edit K2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultK2 = 6
ABCDEFGHIJK
1OrderDateCustomerProductCategoryQtyPriceStatusCustomerMara Okafor
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00ShippedLast order row6
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

Google Sheets and older Excel

XMATCH is missing from Google's function list, and Microsoft marks it as new in Excel 2021, so a file that uses it shows #NAME? in Google Sheets and in Excel 2019 or older. MATCH works everywhere. In Excel 2021 or later, XLOOKUP with search mode -1 returns the last match's value directly; see XLOOKUP vs INDEX MATCH.

Which should a beginner learn first?

MATCH, always with 0 as the third argument, because it works in both apps and in every version, and it's the half of INDEX MATCH you'll use most. Add XMATCH later for last-match and wildcard searches if your Excel has it.

Check yourself

One real exercise from the “Lookups” unit. Checked on our server; no account needed.

In which position of the price list is the product in M1? Use MATCH on the Product column and put the answer in M2.

  • Use MATCH
Select M2 and type = to start its formula (in the cell or the formula bar)
ABCDEFGHIJKLM
1OrderSKUQtySKUProductPriceStockProductCeramic pot
22001PL-1042PL-101Fern$9.5040Position
32002PT-2101PL-104Monstera$34.0012
42003TL-3013PL-107Snake plant$22.0025
52004PL-1011PT-210Terracotta pot$12.5060
62005SL-4014PT-212Ceramic pot$19.0018
72006PL-1041TL-301Watering can$18.009
82007PT-2122SL-401Potting mix$7.2580
92008PL-1071

Common mistakes

  • Leaving out MATCH's third argument, which defaults to approximate match and returns wrong positions on unsorted data.

  • Using XMATCH in a file shared with Google Sheets users.

  • Expecting a row number on the sheet: both return the position inside the range, so H5 is position 4 of H2:H8.

Questions

Does MATCH return the row number?+

It returns the position within the range you give it. For the sheet's row number, add the number of rows above the range.

Can MATCH find the last match?+

Not directly. In Excel 2021 or later use XMATCH or XLOOKUP with search mode -1.

Reading is step one. Now make it stick.

Practise it in a five-minute lesson on a live sheet, with instant feedback. No account needed for the free units.

Practise MATCH in the course

Sources

Official documentation the facts on this page were checked against.