Index Match Excel Formula Guide
In this article
Use the INDEX and MATCH functions together in Excel to perform vertical lookups that are more flexible and reliable than the standard VLOOKUP. This combination allows you to search for a value in a specific row and return a result from a specific column, handling data that is not sorted or where the lookup column is not the first column in the table.
What You'll Need
- A computer with Microsoft Excel installed (Excel 2010 or later is recommended for the best compatibility).
- A spreadsheet containing the data you wish to analyze, with at least two columns of information.
- Familiarity with basic spreadsheet navigation (clicking cells, typing text).
Step-by-Step
Follow these steps to build the INDEX-MATCH formula. We will assume you have a table where Column A contains names and Column B contains sales figures. You want to find the sales figure for a specific name.
- Open your Excel workbook and navigate to the cell where you want the result to appear.
- Type the beginning of the formula: Type
=INDEX(into the cell. This is the function that will return the value. - Select the return range: Click and drag to highlight the entire column (or row) that contains the data you want to retrieve. In our example, this is the sales figures in Column B. Do not select the header. Close the parenthesis for this function by typing
). Your formula should look like=INDEX(B:B,. - Insert the MATCH function: Immediately after the closing parenthesis of the INDEX function, type a comma
,and then typeMATCH(. This tells Excel to find the position of the item you are looking for. - Select the lookup value: Click on the cell that contains the specific item you are searching for (e.g., the name "John Doe" in cell D2). Close the parenthesis for this function by typing
). The formula now reads=INDEX(B:B,MATCH(D2,. - Select the lookup array: Click and drag to highlight the entire column that contains the items you are searching through (e.g., the names in Column A). Type a closing parenthesis
)to complete the MATCH function. The formula is now=INDEX(B:B,MATCH(D2,A:A)). - Specify the match type: The MATCH function requires a third argument to tell Excel how to find the value. Type a comma
,and then type0. This tells Excel to find an exact match. The final formula should be=INDEX(B:B,MATCH(D2,A:A,0)). - Press Enter: Press the Enter key on your keyboard. Excel will calculate the position of the lookup value in the array and return the corresponding value from the return range.
Common Mistakes
When building INDEX-MATCH formulas, errors often stem from incorrect range selection or match type settings. The first and most frequent error is failing to press the F4 key to lock the row or column references. If you drag the formula down or across, the ranges will shift and point to the wrong data, resulting in #REF! errors.
Another common mistake is not closing all the parentheses. The formula requires three closing parentheses at the end: one for the MATCH function, one for the INDEX function, and one to close the entire equation. Missing one will result in a syntax error.
Finally, users often confuse the order of the arguments. Remember the order INDEX(return_range, MATCH(lookup_value, lookup_array, 0)). If you switch the first two arguments or forget the comma between them, the formula will not work correctly.
Tips
One of the biggest advantages of INDEX-MATCH over VLOOKUP is its ability to look to the left. Because MATCH searches for a value within a range and returns its position number, you can place your lookup column anywhere in the table, not just in the first column. This makes your spreadsheets more resilient to changes in data layout.
It is also highly recommended to use table references (like Table1[Sales]) instead of cell references (like B:B) when possible. If you insert or delete rows of data in the middle of your table, a standard column reference like B:B will shift and corrupt your data. A table reference automatically expands to include new data, keeping your formulas accurate.
For horizontal lookups (searching across a row), the process is similar. You would use MATCH(lookup_value, lookup_array, 0) to find the row number, and then use INDEX(return_range, 1, MATCH(...)) to retrieve the value from the first row of that column.
Troubleshooting
If your formula returns #N/A, it means Excel cannot find the lookup value in the lookup array. First, check for hidden spaces or non-printing characters. Sometimes data copied from the web or another system will have trailing spaces that make the value look identical but are technically different. Use the TRIM() function on your data or the lookup cell to remove them.
If you are sure the data matches, check the data types. A number formatted as text (coming from a CSV file) will not match a pure number in the lookup array. You may need to use the VALUE() function or the NUMBERVALUE() function to convert the text to a numeric format.
If the formula returns #VALUE!, it is usually a syntax error. Check to ensure that you have not omitted any commas or parentheses. Ensure that the lookup value is a single value and not an array or a range. If you are referencing a range in the lookup array, ensure you have selected the entire column and not just a single cell.
Frequently Asked Questions
Is INDEX-MATCH faster than VLOOKUP?
Yes, INDEX-MATCH is generally faster and more efficient than VLOOKUP, especially in very large datasets. VLOOKUP must scan the entire column from the top down every time it is calculated, whereas INDEX-MATCH only has to scan the lookup array once to find the position, making it more suitable for performance-heavy applications.
Can I use INDEX-MATCH for vertical lookups?
Yes, this is the most common use case. The MATCH function determines the row number, and the INDEX function retrieves the value from that row. This allows you to search for a value in any column and return a result from a different column.
Why does my formula return #REF!
A #REF! error usually means your lookup array is not large enough to contain the value you are searching for. For example, if your lookup array is A1:A10 and you try to search for a value, the MATCH function will look for it in rows 1 through 10. If the value is past row 10, the function will return a row number that exceeds the array size, causing the INDEX function to return the #REF! error.
Does INDEX-MATCH work in Google Sheets?
Yes, the INDEX and MATCH functions are native to both Microsoft Excel and Google Sheets. The syntax and logic are identical, so you can use the exact same formulas in both applications.
What is the difference between MATCH and LOOKUP?
MATCH is designed to find the position of a specific value within a range and returns the relative position as a number. LOOKUP is a generic function that attempts to find a value in a vector or array and return the corresponding value from another vector. MATCH is more precise and allows you to specify the match type (exact, approximate, or less than).