top of page

You are learning Functions and Formulas in MS Excel

How do I use the INDEX MATCH combination for lookups?

The INDEX MATCH combination is a powerful tool in Excel for performing advanced lookups. Here's a breakdown of how it works:

The INDEX function:

- Takes two arguments:
1. reference: The range of cells containing the data you want to retrieve (the table you're searching in).
2. row_num: The row number within the reference range from which you want to return a value.

The MATCH function:

- Helps you find the row number within the reference range based on a lookup value.
- Takes three arguments:
1. lookup_value: The value you're searching for (what you want to match).
2. lookup_array: The range of cells containing the data you want to search (same as the reference range for INDEX).
3. match_type (optional): Specifies how to match the lookup value.
- By default (0): Exact match
- 1: Approximate match (closest value greater than lookup value)
- -1: Approximate match (closest value less than lookup value)

Combining INDEX and MATCH:

1. Use the MATCH function to find the row number of the lookup value within the reference range.
2. Use the INDEX function with the retrieved row number and the reference range to get the corresponding value from the desired column.

Here's an example:

You have a table with product names (column A) and prices (column B). You want to find the price of a specific product (e.g., "Apple").

Formula:

`=INDEX(B2:B10, MATCH("Apple", A2:A10, 0))`

- Breakdown:
- `MATCH("Apple", A2:A10, 0)` finds the row number (let's say 3) where "Apple" is present in column A (A2:A10).
- `INDEX(B2:B10, 3)` uses that row number (3) to retrieve the value from column B (B2:B10), which is the price of "Apple".

Benefits:

- More flexible than VLOOKUP (can search for values not in the leftmost column).
- Handles errors gracefully (returns #N/A if no match is found).
- Can be used for two-way lookups (finding both row and column positions).

Tips:

- Ensure your lookup value matches the data type (text or number) in the lookup array.
- Use absolute cell references for the reference range (`$B$2:$B$10`) if you plan to copy the formula elsewhere.

By mastering INDEX and MATCH, you can unlock powerful data retrieval capabilities in Excel!

bottom of page