INDEX vs XLOOKUP

INDEX with MATCH was for years the flexible alternative to VLOOKUP; XLOOKUP does the same with a single function.

INDEXXLOOKUP
Available inEvery versionExcel 365 and 2021
Functions neededTwo: INDEX(MATCH(…))One
Look to the leftYesYes
Look up row and column at onceYes, with two MATCHesYes, 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.

Advertising
Loading ad...

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.

Example=INDEX(A2:A8,MATCH(F2,C2:C8,0))INDICE = INDEXCOINCIDIR = MATCH

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.

F3
ABCDEFG
1NameRoleID
2Marisol PeñaManagerE-101IDE-105
3Fernando RuizAnalystE-102Name
4Gabriela SotoDesignerE-103
5Hugo LaraAccountantE-104
6Daniela VegaDeveloperE-105
7Óscar DíazSales repE-106
8Natalia CruzAssistantE-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.