Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
03-02-Perform Complex Lookups with INDEX MATCH and Validation Lists-Start.xlsx11.6 KB 03-02-Perform Complex Lookups with INDEX MATCH and Validation Lists-Complete.xlsx
11.8 KB 3.02 perform-complex-lookups-with-index-match - Exercise.docx
43.4 KB Exercise - Perform Complex Lookups with INDEX and MATCH.xlsx
11.2 KB 3.02 perform-complex-lookups-with-index-match - Exercise solution.docx
214.1 KB Exercise Solution - Perform Complex Lookups with INDEX and MATCH.xlsx
12.7 KB
Quick reference
Perform Complex Lookups with INDEX, MATCH, and Data Validation Lists
Learn how to combine the INDEX and MATCH functions to create a powerful and flexible lookup formula.
When to use
We use INDEX and MATCH to perform a lookup whenever we are looking up information in a table that exists in a column to the left of the lookup value.
Instructions
VLOOKUP is by far the most popular and best-known out of all of the lookup functions in Excel. However, it has its limitations.
The Limitations of VLOOKUP
The main limitation of VLOOKUP is that it can only search from left to right. This means that our lookup value must exist in a column to the left of the value we need to return.
Take a look at the screenshot below. If we want to perform this lookup using VLOOKUP, we quickly run into problems.
The lookup value is the 'Company' and we need to return the 'Company No'. However, the 'Company No' is to the left of the 'Company' column in the table and VLOOKUP can only search left to right.
When we need to specify the column to return in the formula, we count the columns from the lookup value column. As the 'Company No' is to the left of the 'Company', the most logical thing to do would be to enter '-1' to tell VLOOKUP to look backwards (right to left).
Unfortunately, negative values are not valid column index numbers so the formula doesn't work.
This is where we can use INDEX and MATCH instead as these formulas combined can lookup any information regardless of where the lookup value is in the table.
What is INDEX?
INDEX and MATCH are two separate functions in Excel that are often used together to perform powerful, flexible lookups.
Let's look at what INDEX does on its own.
The INDEX function allows us to index a range of cells and return a value from the row number we specify.
The first argument, array is always the range of cells that contains what we want to return. We want to return the 'Company No' so we need to select the 'Company No' array.
In this example, we are looking up the company 'Gaggle'. If we look in the table, 'Gaggle' is in row number 6.
This produces the correct result BUT we had to manually supply the row number. That's easy in a small dataset like this, but not so easy if we have a dataset with thousands of rows.
With that in mind, let's take a look at the MATCH function on its own.
What is MATCH?
The MATCH function will look for a value we specify in a range of cells and return the row number.
In this example, we are matching 'Gaggle' (J7), in the company range (C8:C15) and we are doing an exact match of the word 'Gaggle' in the table (0).
The MATCH function returns the row number.
Use INDEX and MATCH Together
We've established that the INDEX function tells Excel what column of information we want to return and the MATCH function automates the finding of the row number.
We can combine INDEX and MATCH to perform a powerful lookup.
We INDEX the array B8:B15 (where our answer is), then we go straight into MATCH to find the row number.
We can use the same formula to return the 'Profit' we just need to modify our array selection to index the 'Profit' column.
Data Validation and Lookups
We can add data validation to make it simple to switch between companies.
- Click in the cell where the data validation needs to go.
- From the Data tab, in the Data Tools group, click Data Validation.
- From the Settings tab, click the drop-down arrow underneath Allow and choose List.
- In the Source field, select the list of companies.
- Click OK.
We can now use this drop-down to quickly cycle between different companies.
The INDEX and MATCH formula always uses the value in cell C7 as the lookup value so when it changes, the formulas will update automatically.
Login to downloadLesson notes are only available for subscribers.