INDEX and MATCH together provide a flexible, powerful way to look up data in Excel, often outperforming VLOOKUP by allowing leftward lookups and resisting column insertions. This combination returns a value from a specified row and column intersection based on criteria you define. No add-ins or special tools are needed—just a working version of Excel and your data organized in a table or range.
What You'll Need
- Microsoft Excel (any recent version: 2010, 2013, 2016, 2019, 2021, or Microsoft 365)
- A dataset with lookup values and return values organized in columns or rows
- Basic familiarity with Excel formulas and cell referencing
Step-by-Step
- Identify your lookup value—the specific item you want to find (e.g., a product ID, name, or date). This is the value MATCH will search for.
- Determine the lookup array—the column or row where Excel should search for that lookup value. For vertical searches, this is a single column; for horizontal, a single row.
- Choose the match type for MATCH: use 0 for an exact match (most common), 1 for less than (requires ascending order), or -1 for greater than (requires descending order).
- Write the MATCH function to find the position of your lookup value:
=MATCH(lookup_value, lookup_array, 0). Replace the arguments with your actual cell references or values. For example, if your lookup value is in cell E2 and you're searching column A (A2:A100), the formula becomes=MATCH(E2, A2:A100, 0). This returns the relative row number where the value is found. - Identify the return array—the column or row from which you want to retrieve a result. This can be to the left, right, above, or below the lookup array.
- Use the INDEX function to return the value at the intersection of a specified row and column. For a simple column lookup, you only need to specify the return array and the row number:
=INDEX(return_array, row_number). - Replace the row_number in INDEX with your MATCH formula:
=INDEX(return_array, MATCH(lookup_value, lookup_array, 0)). Continuing the example, if you want to return a value from column B (B2:B100) when the product ID in E2 is found in column A, the full formula is=INDEX(B2:B100, MATCH(E2, A2:A100, 0)). - Press Enter to execute the formula. Excel will return the corresponding value from the return array based on the position found by MATCH.
- To copy the formula down or across, use absolute references (lock with $) for the arrays if needed—for example,
=INDEX($B$2:$B$100, MATCH(E2, $A$2:$A$100, 0))—so the ranges don’t shift when copied. - For two-way lookups (matching both row and column headers), use two MATCH functions inside INDEX:
=INDEX(data_array, MATCH(row_lookup, row_header_array, 0), MATCH(col_lookup, col_header_array, 0)). For instance, to find sales for a specific product in a specific month from a table where products are rows and months are columns, MATCH finds the row and column positions, and INDEX returns the intersecting cell.
Common Mistakes
- Using approximate match (1 or -1) when you need an exact match—this can return incorrect results if data isn’t sorted properly. Always use 0 for exact matches unless you specifically need a range lookup and your data is sorted.
- Mismatched array sizes: the lookup array in MATCH and the return array in INDEX must cover the same number of rows (for vertical) or columns (for horizontal). If MATCH searches 10 rows but INDEX references 12, you’ll get #REF! or wrong results.
- Forgetting to lock ranges when copying formulas—this causes references to shift and break the lookup. Use $ to absolute-copy critical ranges (e.g., $A$2:$A$100).
- Using whole-column references (like A:A) unnecessarily—while functional, they can slow down large workbooks. Prefer exact ranges (e.g., A2:A1000) when possible.
- Confusing the order of arguments in INDEX: it’s
INDEX(array, row_num, [column_num]), not the reverse. Swapping them leads to errors or incorrect returns. - Not handling missing values—when MATCH doesn’t find a match, it returns #N/A, which propagates to INDEX. Wrap the formula in IFERROR if you prefer a blank or custom message:
=IFERROR(INDEX(B2:B100, MATCH(E2, A2:A100, 0)), "Not found").
Tips
- Use named ranges to make formulas more readable: define names like "ProductList" for A2:A100 and "Prices" for B2:B100, then write
=INDEX(Prices, MATCH(E2, ProductList, 0)). - For case-sensitive lookups, combine MATCH with EXACT in an array formula (in older Excel) or use XLOOKUP if available—but note that standard MATCH is not case-sensitive.
- If your data has duplicates, MATCH returns the position of the first match only. To handle multiple matches, consider using FILTER or AGGREGATE with INDEX, or pivot tables for summarization.
- INDEX and MATCH work seamlessly with Excel Tables—when you click to select a column in a Table, Excel uses structured references like
Table1[Column], which auto-expand as data is added. - Performance tip: in large datasets, INDEX/MATCH is often faster than VLOOKUP because it doesn’t scan unnecessary columns—it only processes the lookup and return columns you specify.
- To debug, use the Formulas > Evaluate Formula tool to step through how MATCH and INDEX are calculating intermediate results.
Troubleshooting
- If you get #N/A: verify the lookup value exists in the lookup array. Check for extra spaces, different data types (e.g., text vs. number), or hidden characters. Use TRIM or CLEAN to clean text, and ensure numbers aren’t stored as text.
- If you get #VALUE!: check that your arrays are valid ranges and that MATCH is returning a number. This error often occurs if MATCH fails and returns an error that INDEX can’t use as a row number.
- If you get #REF!: this means the row or column number from MATCH is outside the bounds of the INDEX array. Double-check that your return array has enough rows or columns to accommodate the result from MATCH.
- If results seem wrong but no error appears: confirm your match type is 0 for exact matches, and that your lookup and return arrays are aligned correctly (same starting point and size).
- If the formula works in one cell but not when copied: check whether you forgot to lock references with $. Relative references shift when copied, which can break the lookup.
- If Excel seems slow or unresponsive: avoid whole-column references (like A:A) in large sheets. Replace them with actual data ranges or use Excel Tables.
- If you’re using an older version of Excel and the formula won’t enter: ensure you’re not accidentally creating an array formula unless intended. Standard INDEX/MATCH with MATCH type 0 does not require Ctrl+Shift+Enter in modern Excel.
Frequently Asked Questions
Can INDEX and MATCH look to the left?
Yes, unlike VLOOKUP which only looks right, INDEX and MATCH can retrieve values from columns to the left of the lookup column because INDEX specifies the return array independently.
Is INDEX/MATCH better than VLOOKUP?
In most cases, yes—it’s more flexible (leftward lookups), safer against column insertions, and often faster. Use VLOOKUP only for simple, rightward lookups in small, static tables.
What if I need to match multiple criteria?
You can concatenate lookup values and arrays (e.g., MATCH(A2&B2, ColumnA&ColumnB, 0)) or use nested INDEX/MATCH with helper columns. For more complex needs, consider FILTER or XLOOKUP if available.
Why does my formula return #N/A even though the value is there?
Most commonly due to data type mismatches (e.g., looking for a number in a column of text numbers) or invisible characters like spaces. Check with ISTEXT, ISNUMBER, or LEN to diagnose.
Can I use INDEX and MATCH with dates?
Yes, dates are stored as numbers in Excel, so they work the same as any other value—just ensure your lookup value and array are both proper Excel dates, not text.
Is there a limit to how large the arrays can be?
Only by Excel’s row and column limits (1,048,576 rows by 16,384 columns). Performance may degrade with very large ranges, but the function itself has no artificial limit.