INDEX vs XLOOKUP
INDEX with MATCH was for years the flexible alternative to VLOOKUP; XLOOKUP does the same with a single function.
| INDEX | XLOOKUP | |
|---|---|---|
| Available in | Every version | Excel 365 and 2021 |
| Functions needed | Two: INDEX(MATCH(…)) | One |
| Look to the left | Yes | Yes |
| Look up row and column at once | Yes, with two MATCHes | Yes, nesting two XLOOKUPs |
| If not found | #N/A (needs IFNA) | Fourth argument |
Syntax and example
INDEX
=INDEX(array, row_num, [column_num])
=INDEX(A2:A8,MATCH(F2,C2:C8,0))
Returns the value at a position in a range. Together with MATCH it makes Excel’s most flexible lookup.
XLOOKUP
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
=XLOOKUP(E2,$A$2:$A$7,$C$2:$C$7,"Not found")
The modern lookup in Excel 365 and 2021: it searches in any direction and matches exactly by default.
Which one to use?
If the file must open in Excel 2016 or older, INDEX+MATCH. If everyone has 365, XLOOKUP is shorter and harder to get wrong.
About Ads
This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.
Ads help us keep WebHerramientas free for everyone
Practice it
Solve the exercise on the sheet; it is checked instantly. See all lessons · Formula translator
INDEX + MATCH
VLOOKUP only returns columns to the right of the one it searches. MATCH(value, range, 0) tells you the value’s position; INDEX(range, position) returns what is at that position. Together they look up in any direction.
In F3, find the name of the employee with the ID in F2. The ID is to the right of the name, so VLOOKUP will not work.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Name | Role | ID | ||||
| 2 | Marisol Peña | Manager | E-101 | ID | E-105 | ||
| 3 | Fernando Ruiz | Analyst | E-102 | Name | |||
| 4 | Gabriela Soto | Designer | E-103 | ||||
| 5 | Hugo Lara | Accountant | E-104 | ||||
| 6 | Daniela Vega | Developer | E-105 | ||||
| 7 | Óscar Díaz | Sales rep | E-106 | ||||
| 8 | Natalia Cruz | Assistant | E-107 | ||||
| 9 |
Tip: while typing, click a cell or drag across several to insert their reference. F4 anchors the reference with $.
Frequently asked questions
- What is the difference between INDEX and XLOOKUP?
- INDEX with MATCH was for years the flexible alternative to VLOOKUP; XLOOKUP does the same with a single function.
- When should I use INDEX or XLOOKUP?
- If the file must open in Excel 2016 or older, INDEX+MATCH. If everyone has 365, XLOOKUP is shorter and harder to get wrong.