INDEX MATCH is a lookup formula pair that returns a value from any column, not just the column to the right of your search key. You write it as =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)): MATCH finds the row number where your key sits, then INDEX pulls the value at that position from a different range. All you need is a table of data and a cell for the answer. This guide walks through the syntax piece by piece, a worked example, the exact-match rule, and the errors that break it.
What You'll Need
- A copy of Microsoft Excel on desktop (Windows or Mac), or Excel for the web. The formula works the same in all three, though labels and dialog boxes can differ slightly by version and region.
- A data table with a column of unique keys (product codes, names, IDs) and at least one other column holding the values you want to return.
- Headers at the top of each column. They are not required by the formula, but they keep ranges readable.
- Basic comfort with cell references and ranges such as
A2:A100.
Step-by-Step
- Identify three ranges. Pick the value you are searching for (the lookup value), the column that contains it (the lookup range), and the column holding the answer (the return range). In a table where column A has product codes, B has names and C has prices, searching a code to get a price means lookup range A, return range C.
- Write MATCH on its own first. In a spare cell, type
=MATCH("SKU-104",A2:A100,0). Excel returns a number, which is the position of that key inside the range. If you searched the whole column and A2 is the first cell, a result of 3 means the key is in A4. Confirm this number is correct before going further. - Understand the third argument. The
0means exact match. Use it almost always. If you leave the argument out, MATCH assumes approximate match, requires the lookup column sorted ascending, and will happily return the wrong row without warning. - Write INDEX on its own. In another spare cell, type
=INDEX(C2:C100,3). This returns the value in the third cell of the return range, which is C4 if the range starts at C2. Check that this is the cell you expected. - Combine them. Replace the
3in INDEX with the MATCH formula:=INDEX(C2:C100,MATCH("SKU-104",A2:A100,0)). This is the full pattern. Excel runs MATCH, gets a row position, and INDEX uses it to pick a value from the other range. - Replace the hard-coded key with a cell reference. Put the search term in a cell, say E2, and write
=INDEX(C2:C100,MATCH(E2,A2:A100,0)). Now changing E2 updates the answer without editing the formula. - Lock the ranges before copying down. Turn relative references into absolute ones with dollar signs so the ranges do not shift as you fill the formula into other rows:
=INDEX($C$2:$C$100,MATCH(E2,$A$2:$A$100,0)). Note that E2 stays relative so it moves with each row, while the two ranges stay fixed. - Copy down and check a few results by eye. Drag the fill handle down the column. Spot-check three or four rows against the source table to confirm the right values are coming back. A shifted range is the most common silent error.
- Wrap it in IFERROR for clean output. If a key is missing, MATCH returns an error and the whole formula fails. Use
=IFERROR(INDEX($C$2:$C$100,MATCH(E2,$A$2:$A$100,0)),"Not found")to show a friendly message instead. - Make the ranges whole columns if the table grows. If rows are added often, you can use full-column references such as
=INDEX(C:C,MATCH(E2,A:A,0)). This is simpler and self-maintaining, but it scans far more cells, so it can slow a very large workbook. A generous fixed range such as$A$2:$A$5000is often a good compromise.
Common Mistakes
- Ranges of different sizes. MATCH's lookup range and INDEX's return range must start and end on the same rows. If MATCH covers A2:A100 and INDEX covers C2:C99, every answer below row 99 is off by one.
- Forgetting the zero. Omitting the exact-match argument produces approximate matches and quietly wrong results, especially in unsorted data.
- Relative ranges that shift on copy. Without dollar signs, filling the formula down moves both ranges downward each row, so later rows search the wrong block of data.
- Number stored as text. A key that looks like
1001but is stored as text will not match a real number, and vice versa. Check with a formula such as=ISNUMBER(A2)or convert with the error-checking options on the ribbon. - Hidden spaces. Trailing spaces from pasted data break exact matches.
TRIMboth sides of the comparison if you suspect this. - Duplicate keys. MATCH returns the first occurrence only. If your key column has repeats, INDEX MATCH gives you the first matching row, which may not be the one you wanted.
Tips
- INDEX MATCH can look left as well as right, because the two ranges are independent. XLOOKUP does this too and is simpler if your Excel version has it, but INDEX MATCH works in every version and in older files shared with others.
- You can return a whole row of values by leaving the INDEX column argument out and making the return range a full row span, or return several columns by nesting it in other functions. Start with the single-value pattern first.
- Name your ranges (select a range, then use the name box to the left of the formula bar) so the formula reads like
=INDEX(Prices,MATCH(E2,Codes,0)). - Two-way lookups work by putting a second MATCH in the column argument of INDEX, matching a column header instead of a row key.
- Use
Evaluate Formulaon the Formulas tab to step through the calculation when a result looks wrong.
Troubleshooting
- #N/A. The key is not found. Confirm the key exists, that it is the same data type (text versus number), and that the lookup range covers the whole column. Look for leading or trailing spaces.
- #REF!. MATCH returned a position larger than the return range, usually because the two ranges do not line up. Make both ranges start and end on the same rows.
- #VALUE!. A position is not a number or a range is malformed. Check that you have not reversed the arguments, and that commas versus semicolons match your region's list separator.
- Wrong but valid-looking answer. Almost always approximate match (missing zero), shifted relative ranges, or duplicate keys. Rebuild the MATCH part alone and check its number against the visible row.
- Formula works on one row but not others. The ranges are relative and drifted when copied. Add dollar signs and recopy.
- Slow workbook. Full-column references in thousands of rows can cause recalculations to drag. Narrow the ranges.
Frequently Asked Questions
Is INDEX MATCH better than VLOOKUP?
It is more flexible. INDEX MATCH can return values to the left of the lookup column and is unaffected by inserting or deleting columns in the return area. VLOOKUP is only shorter to type.
Do I need a sorted list?
No, not with the exact-match argument of zero. Sorting is only required for approximate match, which you rarely want.
Can I use INDEX MATCH across two sheets?
Yes. Reference the other sheet in both ranges, for example Sheet2!$A$2:$A$100. Keep the sheet name quoted if it contains spaces.
Why does my result show #N/A when the value is clearly there?
Nine times out of ten the two values differ in type or have hidden spaces. Compare them with =A2=E2; a FALSE result confirms a mismatch even when they look identical.
What if there are duplicate values?
INDEX MATCH returns the first match only. To get later matches you need a different approach, such as a helper column that numbers each occurrence.
Does it work in Excel for the web and on Mac?
Yes, the formula syntax is identical. Only interface labels differ slightly between versions and platforms.