Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
03-03-Two Way Lookups with INDEX MATCH or XLOOKUP-Start.xlsx11.3 KB 03-03-Two Way Lookups with INDEX MATCH or XLOOKUP-Complete.xlsx
13.5 KB 3.03 two-way-lookups-with-index-and-match-or-xlookup - Exercise.docx
43 KB Exercise - 2-Way Lookups.xlsx
10.9 KB 3.03 two-way-lookups-with-index-and-match-or-xlookup - Exercise solution.docx
130.8 KB Exercise Solution - 2-Way Lookups.xlsx
12 KB
Quick reference
Two-Way Lookups with INDEX and MATCH or XLOOKUP
Use INDEX and MATCH or the new XLOOKUP function to perform a two-way lookup in a table.
When to use
We do a two-way lookup whenever we have two pieces of criteria to look up in a table.
Instructions
A two-way lookup differs from a standard 1-way lookup in that we are using two lookup values to find our answer in the table. This situation occurs when we have column headings and row headings in a table and need to use both to find the answer.
In this example, we need to look up the month and the team in order to find our answer.
We can complete this task using INDEX and MATCH or the new XLOOKUP function.
Use INDEX and MATCH to Perform a 2-Way Lookup
- Type =INDEX into the cell.
Note that the INDEX function has two arguments, row_num, and column_num (optional). In the last lesson, we only used the row_num argument as we only had one lookup value. This time we need to use both.
The array is the range of cells where our answer is. Our answer could be any of the values in the table.
- For the row_num argument, we are going to use MATCH to find the row number for us.
We are matching the first piece of criteria, 'Sales Team 1' (B16) in the 'Team' range (B8:B12) and we are doing an exact match (0).
We can then move on to the column_num argument where we specify our second piece of criteria with another MATCH. This time, we are matching the 'Month' (C15) in the 'Month' range (C7:N7) and we are doing an exact match.
Don't forget to close off the parenthesis for both MATCH and INDEX.
The formula returns the correct result from the table.
Use XLOOKUP to Perform a 2-Way Lookup
XLOOKUP is one of the newer functions in Excel and is only available in Excel for Microsoft 365, Excel 2019, and Excel 2021. XLOOKUP is as powerful as INDEX and MATCH but isn't as complex to understand.
Let's perform the same lookup but use XLOOKUP instead.
XLOOKUP has 6 arguments, the last 3 are all optional. XLOOKUP requires us to provide the lookup_value (what we are looking up), the lookup_array (where we will find the lookup value), and the return_array (what we want to return).
The first lookup value is 'Sales Team 1' (B16) and we are looking it up in the 'Team' range (B8:B12).
Instead of typing the return_array we need to add our second lookup.
The lookup value is 'Aug' (C15) and we are looking it up in the 'Month' range (C7:N7).
We can now provide the return_array (where our answer is).
The correct result is returned from the table.
Login to download
Lesson notes are only available for subscribers.