Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel INDEX MATCH Lookup Guide

· 8 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can perform a lookup in Excel without using the VLOOKUP function. By combining the INDEX function with the MATCH function, you create a more flexible and powerful lookup system that allows you to search in any column, not just the first one, and find exact matches or the nearest value. This method, often called INDEX-MATCH, is generally considered the industry standard for advanced Excel users because it resolves the major limitations of VLOOKUP.

What You'll Need

  • A computer with Microsoft Excel installed (Excel 2010 or later is recommended as it supports array formulas natively).
  • A spreadsheet containing data with at least two columns: one for the lookup value (the data you know) and one for the result (the data you want to find).
  • A basic understanding of spreadsheet terminology (cells, ranges, and columns).

Step-by-Step

The INDEX-MATCH formula consists of two parts: the MATCH function, which finds the row number of your data, and the INDEX function, which retrieves the value from that row. Here is how to build it from scratch.

  1. Create a new spreadsheet or open an existing one. For this guide, assume you have a list of employees in column A, their ID numbers in column B, and their salaries in column C. Your goal is to find an employee's salary based on their ID.
  2. Identify your lookup value and result range. In this example, the lookup value is the ID number you will type into a cell. The result range is the column containing the salaries (Column C). The lookup range is the column containing the IDs (Column B).
  3. Click on the cell where you want the result to appear. This is where the INDEX-MATCH formula will be entered.
  4. Start typing the formula with the MATCH function. Type =MATCH(. This function requires three arguments: the lookup value, the lookup array, and the match type.
  5. Enter the first argument: the lookup value. Click on the cell that contains the ID number you want to search for. If you haven't typed it in yet, you can type the number directly. For this example, let's assume you clicked on cell E2, which contains the ID number you are searching for. Your formula should now look like this: =MATCH(E2,.
  6. Enter the second argument: the lookup array. This is the range of cells that Excel should search through to find the ID number. In our example, the IDs are in Column B, from row 2 to row 10. So, type B2:B10. Your formula is now =MATCH(E2, B2:B10,.
  7. Enter the third argument: the match type. This tells Excel how to find the value. The options are:
  8. 1 or omitted (approximate match). Excel finds the largest value that is less than or equal to the lookup value. This is useful for looking up tax brackets or grades. The array must be sorted in ascending order for this to work.
  9. 0 (exact match). This is the most common setting. It finds the first exact match for the lookup value. The array does not need to be sorted. This is the setting you will use for most ID lookups and name lookups.
  10. -1 (exact match or greater). Excel finds the smallest value that is greater than or equal to the lookup value. This is rarely used. The array must be sorted in descending order.
  11. Select 0 for an exact match. Type 0 to complete the MATCH function. The formula should now look like this: =MATCH(E2, B2:B10, 0). Press Enter to see the result. This will give you a number representing the row number where the ID is found (e.g., 5).
  12. Wrap the MATCH function with the INDEX function. The INDEX function returns a value from a range based on a row and column number. Its syntax is =INDEX(array, row_num, [column_num]).
  13. Replace the existing formula with the new combined formula. Start typing =INDEX(C2:C10,. This tells Excel that the result should come from the Salary column (C2:C10).
  14. Insert the MATCH function as the second argument. Instead of typing a row number, type the entire MATCH function you just created. This will calculate the correct row number dynamically. Your formula should now look like this: =INDEX(C2:C10, MATCH(E2, B2:B10, 0)).
  15. Close the parentheses and press Enter. The final formula is =INDEX(C2:C10, MATCH(E2, B2:B10, 0)). Pressing Enter will now return the correct salary for the ID in cell E2.

Common Mistakes

When using INDEX-MATCH, a few specific errors frequently occur. Understanding these pitfalls is key to making the formula work correctly.

The first common mistake is using the wrong match type. If you are looking for an exact match (like an ID number) and you omit the third argument or use 1, Excel will return an incorrect result if there is no exact match. It will find the largest value that is less than your lookup value. Always use 0 for exact matches.

A second frequent error is referencing the wrong range for the lookup array. The lookup array must be the same size as the result range. If your IDs are in B2:B10 but your salaries are in C2:C12, the formula will return #N/A. Check that both ranges have the same number of rows.

Finally, a common mistake is not locking the ranges with dollar signs. If you copy the formula to another cell, the ranges will shift, causing an error. To fix this, add dollar signs to the range references. For example, change B2:B10 to $B$2:$B$10. This locks the range so it does not change when the formula is copied.

Tips

Here are some practical tips to make your INDEX-MATCH formulas more robust and easier to use.

Use the IFERROR function to handle lookup failures gracefully. If the lookup value is not found, the formula will return #N/A. Wrapping the formula in IFERROR allows you to display a custom message instead. For example, =IFERROR(INDEX(C2:C10, MATCH(E2, B2:B10, 0)), "Not Found") will display "Not Found" if the ID is not in the list.

When looking up values across multiple columns, you can add a third argument to the INDEX function. The syntax is =INDEX(array, row_num, [column_num]). For example, if you have data in columns B, C, and D, and you want to return a value from the third column, you can add , 3 to the end of the formula: =INDEX(C2:D10, MATCH(E2, B2:B10, 0), 3).

For very large datasets, INDEX-MATCH is significantly faster than VLOOKUP. This is because VLOOKUP must scan the entire column every time, while INDEX-MATCH only scans the lookup array. This can result in noticeable performance improvements when working with hundreds of thousands of rows of data.

Troubleshooting

If your INDEX-MATCH formula is not working as expected, follow these steps to identify and fix the problem.

The first thing to check is the #N/A error. This means that Excel could not find the lookup value in the lookup array. Verify that the lookup value is spelled correctly and that it exists in the range you are searching. Also, check for extra spaces or hidden characters that might cause a mismatch.

If you are using an approximate match (match type 1 or omitted) and getting an error, check if your data is sorted in ascending order. If the data is not sorted, the MATCH function cannot find the correct position.

If you see the #REF! error, it usually means you have referenced a range that does not exist. This can happen if you deleted rows or columns from your spreadsheet after creating the formula. Double-check the range references in your formula to ensure they are valid.

If you are getting unexpected results, check the match type. If you intended to find an exact match but used 1, Excel will return the largest value that is less than your lookup value. Change the match type to 0 to get an exact match.

Frequently Asked Questions

Can I use INDEX-MATCH to look up data to the left of the lookup value?

Yes, this is one of the biggest advantages of INDEX-MATCH over VLOOKUP. VLOOKUP can only look to the right of the lookup value. INDEX-MATCH can look in any direction. You simply change the result array in the INDEX function to include the column you want to retrieve data from.

Why is INDEX-MATCH better than VLOOKUP?

INDEX-MATCH is better than VLOOKUP for several reasons. It is not limited to looking to the right of the lookup value. It can handle approximate matches more reliably. It is generally faster, especially with large datasets. It does not break if you insert a new column between your lookup value and the result range.

What does the #N/A error mean in INDEX-MATCH?

The #N/A error means that the lookup value cannot be found in the lookup array. It does not mean there is an error in the formula itself. You should use the IFERROR function to handle this error and display a custom message.

Can I use INDEX-MATCH with wildcards?

No, the MATCH function does not support wildcards. If you need to perform a partial match (like searching for a name that contains a specific letter), you will need to use a different method, such as the FILTER function in Excel 365 or the SUMPRODUCT function in older versions.

How do I look up a value based on two criteria?

INDEX-MATCH can be nested to look up a value based on two criteria. The MATCH function can only search for one value, so you need to create a helper column that combines the two criteria into a single unique identifier. For example, if you are looking up a person by both their first and last name, you can create a column that concatenates the two names and use that column as the lookup array.