What MATCH does
MATCH finds a value in a row or column and returns its position as a number: =MATCH("Pears",A2:A7,0) gives 4, because Pears is the fourth item in A2:A7. To get the value itself, MATCH goes inside INDEX, and the pair is the lookup known as INDEX MATCH.
That number is what makes MATCH useful. Hand it to INDEX and the pair becomes a full lookup: MATCH finds the row where the value is, and INDEX returns what’s in that row of another column. The two ranges are separate, so the answer can be on either side of the column you search.
Positions count from the start of the range you give MATCH, starting at 1.
Syntax
lookup_valueRequired- What to find, such as
"Pears"or a cell likeB8. lookup_arrayRequired- The single row or column to search, such as
A2:A7. match_typeOptional0for an exact match, which is what most lookups need.1, the default when you leave it out, finds the largest value that is less than or equal to the one you look for, in a list sorted in ascending order;-1does the reverse for a descending list.
Example: where is an item in a list
The products are listed in A2 to A7.
The 0 asks for an exact match. Text matches in any capitals, so “pears” finds the same position.
Example: INDEX with MATCH, looking to the left
The staff list has names in column A and staff numbers in column C. VLOOKUP can’t return a name from the left of the number it searches; INDEX with MATCH can.
Read it from the inside out: find B8 in C2:C6 (position 4), then return item 4 of A2:A6.
INDEX and MATCH with two criteria
MATCH looks for one value, so to match two columns at once you have it look for a 1. With regions in A2:A20, products in B2:B20 and sales in C2:C20, =INDEX(C2:C20,MATCH(1,(A2:A20=F1)*(B2:B20=F2),0)) returns the sales for the region in F1 and the product in F2.
Each comparison in brackets gives TRUE or FALSE for every row. Multiplying the two turns them into 1s and 0s, with a 1 only where both are true. MATCH returns the position of the first 1, and INDEX takes the sales from that row. Microsoft 365 and Excel 2021 or later accept the formula with a plain Enter; older versions need Ctrl+Shift+Enter (Cmd+Shift+Return on a Mac). In the newer versions, XLOOKUP with multiple criteria does the same with a shorter formula.
Common mistakes
- Without the last argument, MATCH uses
1and looks for the nearest smaller value in a sorted list. On an unsorted list that gives wrong positions without any error, so write0for exact matches. - MATCH searches one row or one column.
A2:C6isn’t a valid search range for it. - If MATCH searches
C2:C6and INDEX returns fromA3:A7, every answer is one row off. Start both ranges on the same row. #N/Afor a value you can see usually means a trailing space, or a number stored as text on one side. Fix the data, or show a message with IFERROR.
Frequently asked questions
What does the 0 in MATCH mean?
It asks for an exact match: MATCH returns the position of the first cell that equals the value, or #N/A when there’s none.
Why is my INDEX MATCH not working?
Check that MATCH ends in 0: without it, MATCH looks for the nearest smaller value and returns wrong rows without any error. Then check that both ranges start on the same row, and that the values really match, since a trailing space or a number stored as text gives #N/A.
How do I compare two columns with MATCH?
Put MATCH inside ISNUMBER: =ISNUMBER(MATCH(A2,$C$2:$C$50,0)) shows TRUE when the value in A2 appears anywhere in C2:C50 and FALSE when it doesn’t. Fill it down to check every row of column A.
Is MATCH case-sensitive?
No. “pears” and “Pears” are the same to MATCH. To match part of a text, use a wildcard with match type 0: =MATCH("Ch*",A2:A7,0) finds the first item that starts with Ch.
Why use INDEX and MATCH instead of VLOOKUP?
INDEX with MATCH can return a column to the left of the one it searches, and inserting columns doesn’t break it, because nothing counts columns by number.
Should I use INDEX and MATCH or XLOOKUP?
XLOOKUP does the same job in one function in Excel 2021, Excel 2024 and Microsoft 365. INDEX with MATCH works in every version, so it’s the safer choice for files shared with people on older Excel.