Get Sheetsprint · ₹399

← Sheetsprint

4 min read

VLOOKUP or XLOOKUP: which lookup should you learn and use?

How the two lookups differ, the version catch, and when INDEX and MATCH is the safer choice.

If you learn one lookup, which should it be? Job postings still ask for VLOOKUP, colleagues send files full of it, and yet newer Excel and Google Sheets offer XLOOKUP, which is easier. Here is how they differ, and when to use each.

What both of them do

A lookup finds a value in one list and brings back related information from the same row. You have a product code on a sales sheet and want its rate from the price list. You have an employee ID and want the department. Instead of searching by eye, one formula does it for every row.

VLOOKUP: four parts, one direction

VLOOKUP needs what to find, the table, the column number to return and FALSE for an exact match. To find the rate of product P105 in a price list where the rate is the fourth column, you write =VLOOKUP("P105",A2:E11,4,FALSE). It has three weaknesses:

  • It can only look to the right. The code must be in the first column of the table.
  • The column number is fragile. Insert a column in the middle of the table and the formula quietly returns the wrong column.
  • If you forget FALSE, it does an approximate match and can return a wrong row without any error.

XLOOKUP: three parts, any direction

XLOOKUP needs what to find, where to look and what to return: =XLOOKUP("P105",A2:A11,D2:D11). It does an exact match by default, it can return a column to the left, inserting columns does not break it, and a fourth part lets you show a message when nothing is found, such as "Not in list", without wrapping the formula in IFERROR. It can also return several columns at once.

The catch: versions

XLOOKUP works in Excel 365, Excel 2021 and newer, and in Google Sheets. In Excel 2019 or older, it shows #NAME?. Many Indian offices still run older Excel on some computers, so if you are sending a file to people you do not know, check what they use.

The middle path: INDEX and MATCH

INDEX with MATCH works in every version and has the strengths of XLOOKUP: any direction, no column numbers. =INDEX(D2:D11,MATCH("P105",A2:A11,0)) finds the position of P105 and picks the rate from the same position. It takes a little longer to learn, but it is the safe choice for shared files.

So which one?

  • Your own work in new Excel or Google Sheets: XLOOKUP.
  • Files shared with people on old Excel: INDEX and MATCH.
  • Reading and fixing other people's files, and interviews: know VLOOKUP well, because you will meet it everywhere.

Whichever you choose, the most common problem is the same: #N/A because of an extra space or a number stored as text. Clean the codes with TRIM before blaming the formula. The Sheetsprint Formula Cards have a worked example of all three lookups on the same price list, so you can compare them side by side.

Keep reading