Sub topic 12
INDEX with MATCH as a Lookup
Assume you know basic Excel formulas, relative and absolute references, and the layout of a simple financial model. This chapter uses an assumptions table with unique keys.
INDEX with MATCH retrieves one value from a list. MATCH finds the position of a key. INDEX returns the value at that position.
| Function | Job |
|---|---|
| `MATCH` | Finds the position of a key |
| `INDEX` | Returns the value at a position |
| `INDEX` with `MATCH` | Finds and returns a value from a related list |
Finding the position with MATCH
Suppose the Assumptions sheet contains this table:
| Row | Key | Value |
|---|---|---|
| 3 | Tax rate | 0.25 |
| 4 | Revenue growth | 0.08 |
| 5 | Exit multiple | 10.0 |
If cell A5 contains Revenue growth, this formula finds its position in the key list:
=MATCH($A5, Assumptions!$B$3:$B$12, 0)The first argument is the value to find. The second is the range to search. The final argument, 0, requires an exact match. If Revenue growth is the second item in the range, MATCH returns 2, not the worksheet row number 4.
Returning the value with INDEX
INDEX can return the item at a position in a range:
=INDEX(Assumptions!$C$3:$C$12, 2)This returns the second value in the value range. To avoid hard-coding the position, place MATCH inside INDEX:
=INDEX(Assumptions!$C$3:$C$12, MATCH($A5, Assumptions!$B$3:$B$12, 0))The inner MATCH finds the position of the key. The outer INDEX uses that position to return the related value. This is an exact-match lookup.
A lookup range and a return range must have the same number of rows. The key and value should also be aligned row by row.
Common errors
- Omitting the
0inMATCHcan request an approximate match. For unordered assumptions, always use0. - Using different-sized ranges can return incorrect results or an error.
- Hard-coding a row number makes the model fragile when rows are inserted or reordered.
- Searching for labels with extra spaces can fail.
Tax rateandTax rateare different text values. - A blank return cell may be a real blank, not evidence that the key was missing.
To give users a clearer missing-key message, wrap the lookup in IFNA:
=IFNA(INDEX(Assumptions!$C$3:$C$12, MATCH($A5, Assumptions!$B$3:$B$12, 0)), "Missing assumption")This keeps an expected missing assumption from displaying a raw error. It should not hide every possible error, because other errors may indicate a broken range or formula.
Checking key uniqueness
Use COUNTIF beside the assumptions list or in a check area:
=COUNTIF(Assumptions!$B$3:$B$12, $A5)A valid unique key should return 1. A result of 0 means the key is missing. A result greater than 1 means the key is duplicated and the lookup is ambiguous.
Exercise
Cell A5 contains "Revenue growth". Write an exact-match INDEX with MATCH formula that returns its value from Assumptions!B3:C12 and displays "Missing assumption" if the key is absent.
Show answer
=IFNA(INDEX(Assumptions!$C$3:$C$12, MATCH($A5, Assumptions!$B$3:$B$12, 0)), "Missing assumption")