INDEX MATCH in Excel: how it works, with multiple criteria
How INDEX MATCH works in Excel, step by step: look up to the left, match on two or more criteria, two-way lookups, and fixes for #N/A and wrong rows.
Look someone up when the first name alone is not enough.
Join the two columns with &, both in what you look for and where you look.
Find the phone extension for each person in E2:F6. Some people share a first name, and some share a last name, so match on both. Put the formulas in G2:G6.
Typing formulas is easiest on a computer with a keyboard.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | First name | Last name | Extension | First name | Last name | Extension | ||
| 2 | Daniel | Garcia | 2541 | Tariq | Rossi | |||
| 3 | Nadia | Novak | 2170 | Nadia | Murphy | |||
| 4 | Daniel | Novak | 2317 | Tariq | Garcia | |||
| 5 | Tariq | Novak | 2632 | Daniel | Murphy | |||
| 6 | Daniel | Murphy | 2471 | Daniel | Garcia | |||
| 7 | Nadia | Murphy | 2275 | |||||
| 8 | Nadia | Rossi | 2107 | |||||
| 9 | Tariq | Rossi | 2219 | |||||
| 10 | Tariq | Garcia | 2422 | |||||
| 11 | Tariq | Murphy | 2688 | |||||
| 12 | ||||||||
| 13 | ||||||||
| 14 | ||||||||
| 15 |
When one column isn't enough to tell rows apart. Two people called Priya, or two called Patel: only the first name and the last name together point to one person. The same goes for a product and a size, or a date and a store.
Join them with & on both sides. Join the two values you are looking for, and join the two columns you search, in the same order:
=XLOOKUP(E2&F2,
$A$2:$A$11&$B$2:$B$11 builds a list of joined names (PriyaPatel, PriyaLi...) for XLOOKUP to search, without adding a column to the sheet.
It's safer: E2&" "&F2 and $A$2:$A$11&" "&$B$2:$B$11. Without one, "Ann" + "Ewing" and "Anne" + "Wing" both become AnnEwing.
INDEX and MATCH work the same way: =INDEX($C$2:$C$11,MATCH(E2&F2,$A$2:$A$11&$B$2:$B$11,0)). Before Excel 365 it had to be entered with Ctrl+Shift+Enter. Another classic fix is a helper column with =A2&B2 that VLOOKUP can search. The INDEX MATCH guide shows all three ways on a real sheet.
How INDEX MATCH works in Excel, step by step: look up to the left, match on two or more criteria, two-way lookups, and fixes for #N/A and wrong rows.
Join two Excel files on a shared column like an ID or email: with XLOOKUP, Power Query, or in your browser with no formulas. Handles missing and duplicate keys.
Know someone fighting with a spreadsheet? Send them this page.