Site icon Professor Excel

XLOOKUP, VLOOKUP or INDEX/MATCH? Big Lookup Functions Guide!

One of the most often used functions when creating an Excel model is consolidating data from different sources. Traditionally, there were 3 major functions for combining data from different tables or worksheets: VLOOKUP, SUMIFS and INDEX/MATCH. Now, Microsoft has introduced XLOOKUP. So what is the difference between these four lookup functions and which one should you use?

This article was updated in September 2021 for regarding the new XLOOKUP function in Excel. For more information about the XLOOKUP function, please refer to this article.

Overview of the four lookup functions

Let’s take a look at each of the four functions separately, before we eventually compare them and see, which one of them to use in what case.

VLOOKUP

VLOOKUP is probably the best known formula for getting data from another table. The application is fairly easy, although there are some common mistakes which people tend to make. The VLOOKUP formula has four parts (“arguments”):

Structure of the VLOOKUP formula in Excel
  1. The lookup value.
  2. The range, where you are going to search in (Excel searches in the left-most column from this range).
  3. The number of column, which you want to be returned (start counting from the left column of the search range).
  4. One optional value, which you can always consider to be “FALSE”

Make sure that you don’t make the most common mistakes as having a too small range (search column as well as return column must be within the search range) and start counting the search column as column number 1.

For more information, please refer to this article.

SUMIFS

SUMIFS only exists since Excel 2007 and is especially useful, as it can regard several search criteria. Also, this application is quite straightforward:

SUMIFS has at least 3 arguments
  1. The column, which the return value is in
  2. The column, which your criteria is in
  3. The lookup value
  4. Optional: Second criteria column
  5. Optional: Second lookup value
Example of VLOOKUP, SUMIFS and INDEX/MATCH

The primary function of SUMIFS is to sum up values matching your criteria. In our case, we must make sure that each criteria combination only exists once in our table. In the example on the right hand side, we would have exactly this problem: There are 3 VW Golfs in our table, so the return value is the sum of the 3 prices.

Please check this article for more information.

INDEX/MATCH

A combination of the two functions index and match has one more advantage than the VLOOKUP: It returns the value from any column and not just on the right hand side of the search column. That usually makes it more stable, because the return column stays the same if you insert more columns in-between.

How to use the INDEX-MATCH function combination in Excel

The INDEX formula returns the n-th value from an array of cells. With MATCH, you can search for a value within an array of cells and it’ll return the number of the first occurrence. Please refer to number 3 in above picture for an example of how to use it.

For more information about how to use INDEX/MATCH please refer to this article.

XLOOKUP

XLOOKUP is the newest addition to the lookup functions in Excel. It solves many problems of VLOOKUP and even INDEX/MATCH. At the same time, it’s comparatively easy to use. Here is the basic structure:

Syntax of XLOOKUP: The XLOOKUP formula can have up to six arguments.

The first three arguments are quite straight forward – the arguments 4 to 6 are optional.

  1. Search value: What do you look for?
  2. Search area: Where to you look (for example a column or row)?
  3. Return area: Where is the return value, can also be a column or row (but should have the same shape as the search area.

Here is a simple XLOOKUP example:

Simple XLOOKUP example.

I won’t go further into detail here. If you want to know more about XLOOKUP, please refer to this article for the basic usage and this article for advanced examples, including the arguments 4 to 6.

Comparison of the lookup functions VLOOKUP, SUMIFS, INDEX/MATCH and XLOOKUP

In the below you can find a comparison of the four functions.

CriteriaVLOOKUPSUMIFSINDEX/MATCHXLOOKUP
ApplicationMediumEasyDifficultEasy
Return numbersYesYesYesYes
Return textsYesNoYesYes
Return columnOnly to the right of the search columnAnyAnyAny
Lookup values exist multiple timesReturn first instanceReturn sumReturn first instanceReturn first or last instance
Stability1LowHighHighHigh
More than one search criteriaNoYesNoNo
CommentWell known among Excel usersVery versatile, can be used for 2D or 3D lookupsVery versatile
Comparison of VLOOKUP, SUMIFS, INDEX/MATCH and XLOOKUP


Do you want to boost your productivity in Excel?

Get the Professor Excel ribbon!

Add more than 120 great features to Excel!


When to use which of the lookup functions

Situation 1: Not everyone around you has access to newer Excel versions and therefore cannot use XLOOKUP

First question: Do you and your co-workers / clients etc. have newer Excel versions (Microsoft 365). If you are not sure, it’s probably not the right time to use XLOOKUP yet. In such case, follow this decision tree:

Follow this decision tree for identifying which function to use.

If your return value is a numeric value (like a number or date), SUMIFS has a some advantages (as shown in the table above) and we recommend using it. If you return value is text, both VLOOKUP and the INDEX-MATCH combination work. The following decisions are then no exclusion criterions but rather matters of convenience.

One more word to the case in which you got more than one search criteria and want to return text: In such case we recommend using a new search column, which combines all the search criteria. For instance, if you are searching for a person by first name and family name and want to return the address, you can concetanate first name and family name into one cell. That way you only have to search for the complete name within one column.

Situation 2: You can assume that all collaborators have access to XLOOKUP

Well, in such case it’s actually much easier:

Simplified decision tree if all collaborators have access to XLOOKUP.

Performance of the lookup functions

Hold on, we haven’t talked about the calculation performance of these four lookup functions yet?

Well, this is a different topic, to my opinion. That’s why I have created separate long articles about the performance of these functions. Click here to see how is the performance of the lookup functions.

Image by Free-Photos from Pixabay

Exit mobile version