Find who earns a given salary (INDEX + MATCH)
The problem
Problem statement
Payroll flagged one salary amount for audit, but the query came back as a number — you need the person. The roster (A2:C6) keeps names in the first column and salaries in the last, and the amount to trace sits in E2. Return the matching employee's name in the Employee cell F2.
Don't assume the roster order — case 3 shuffles it, so the row number has to be computed.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | C | E | F | |
|---|---|---|---|---|---|
| 1 | Employee | Dept | Salary | Salary | Employee |
| 2 | Alex Zhang | Engineering | 18500 | 15000 | |
| 3 | Betty Lin | Design | 22000 | ||
| 4 | Chris Wu | Sales | 15000 | ||
| 5 | David Chen | Operations | 31000 | ||
| 6 | Emma Liu | Marketing | 26000 |
Notes
This is a reverse lookup: the search key is on the right of the value you want. VLOOKUP cannot look left without a helper column, but MATCH finds the row and INDEX fetches any column from it — the classic interview answer.
How to approach
Your answer goes in F2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Target cell is F2
- First find WHERE the salary in E2 sits:
MATCH(E2, C2:C6, 0)returns its row number - Then fetch the name from that row:
INDEXtakes the name column and that row number - Shape:
=INDEX(?, MATCH(?, ?, 0))— theMATCHresult is the rowINDEXneeds
Official solutions
Show 2 solutions — try it yourself first
Approach 1: INDEX outer, MATCH inner
=INDEX(A2:A6, MATCH(E2, C2:C6, 0))
MATCH scans the salary column C2:C6 for the exact amount in E2 and returns its position. INDEX then pulls the same-position name from A2:A6. The 0 in MATCH forces exact matching.
Approach 2: XLOOKUP equivalent
=XLOOKUP(E2, C2:C6, A2:A6)
Modern Excel solves the same problem in one call: search C2:C6, return from A2:A6. Worth knowing both — interviews often ask what XLOOKUP replaced.
Function guide
FAQ
How do I look left in a table?
Use INDEX + MATCH: =INDEX(A2:A6, MATCH(E2, C2:C6, 0)). MATCH locates the row by the salary, INDEX returns the name from the same row — no helper column needed.
What does the 0 in MATCH mean?
It sets the match type to exact. With 1 or -1, MATCH assumes sorted data and returns an approximate position, which silently produces wrong names here.
Why prefer INDEX/MATCH over VLOOKUP for this?
VLOOKUP only searches the leftmost column of its table and returns columns to the right. When the key sits to the right of the result — like salary here — INDEX/MATCH (or XLOOKUP) is the standard answer.