How to use MATCH in Excel
MATCH returns the position of a value in a list (1, 2, 3…), not the value itself. On its own it answers "which row is it in?"; together with INDEX it becomes a flexible lookup.
Syntax
=MATCH(lookup_value, lookup_array, 0)
lookup_value | What to find. |
lookup_array | A single column or row to search. |
[match_type] | 0 = exact match. 1 (default) = largest value ≤ lookup (sorted ascending). −1 = smallest value ≥ lookup (sorted descending). |
Examples
=MATCH("P04", A2:A100, 0)Position of P04 in the list.=MATCH(E2, B1:M1, 0)Which column holds the month in E2.=INDEX(C2:C100, MATCH(E2, A2:A100, 0))The INDEX/MATCH lookup.Find which row a value is in
MATCH doesn't return the value itself, it returns its position: 1 for the first cell of the range, 2 for the second, and so on. That sounds small, but it's the piece that makes lookups flexible: once you know the row, INDEX can bring back any column from it.
=MATCH("Granite Build", B2:B200, 0)The position of the client in the list, for example 7.=MATCH(E2, A2:A200, 0)The position of the account ID in E2. #N/A means it isn't in the list.A two-way lookup: row and column
Use one MATCH for the row and another for the column, and INDEX picks the cell where they cross. This is how you read a value from a price grid or a monthly report by both the name and the month.
=INDEX(B2:M50, MATCH(P2, A2:A50, 0), MATCH(Q2, B1:M1, 0))The value for the product in P2 and the month in Q2.=MATCH(Q2, B1:M1, 0)On its own: the column number of the month, which you can also feed into VLOOKUP.Check if a value exists in another list
In a reconciliation you often only need a yes or no: is this ID in the other report? Wrap MATCH in ISNUMBER, because MATCH returns a number when it finds the value and #N/A when it doesn't.
=IF(ISNUMBER(MATCH(A2, Report!$A:$A, 0)), "Found", "Missing")Flags every ID that's missing from the other sheet.=ISNUMBER(MATCH(A2, $D$2:$D$500, 0))TRUE or FALSE, ready for a filter or conditional formatting.Common mistakes
- Missing the 0
- Without 0 MATCH does an approximate match on unsorted data and returns nonsense.
- Position is relative
- MATCH counts from the start of the range, not from row 1 of the sheet.
Frequently asked questions
What does the 0 mean in MATCH?
Exact match. Without it, MATCH uses 1, an approximate match that expects a sorted list and can quietly return the wrong position. For IDs, names and codes, always write 0.
Why does MATCH return #N/A?
The value isn't in the range, or it only looks the same: an extra space, a different spelling, or a number stored as text. =ISNUMBER(A2) and =LEN(A2) show which one it is.
What's the difference between MATCH and XMATCH?
XMATCH is the newer version in Microsoft 365 and Excel 2021: exact match by default, and it can search from the bottom up. MATCH works in every version.
Is MATCH case-sensitive?
No. "elm studio" and "Elm Studio" are the same to MATCH. A case-sensitive search needs MATCH(TRUE, EXACT(A2:A100, E2), 0).
How do I use MATCH with INDEX?
MATCH finds the row, INDEX returns the value from that row: =INDEX(C2:C100, MATCH(E2, A2:A100, 0)). Practise it in INDEX, and see why it beats VLOOKUP in VLOOKUP vs XLOOKUP.
Available in: All versions of Excel, Excel for the web, Google Sheets