4 C
London
Friday, December 20, 2024
HomeSoftware TutorialsExcelExcel: How to Use VLOOKUP to Return All Matches

Excel: How to Use VLOOKUP to Return All Matches

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

By default, the VLOOKUP function in Excel looks up some value in a range and returns a corresponding value only for the first match.

However, you can use the following syntax to look up some value in a range and return corresponding values for all matches:

=FILTER(C2:C11, E2=A2:A11)

This particular formula looks in the range C2:C11 and returns the corresponding values in the range A2:A11 for all rows where the value in C2:C11 is equal to E2.

The following example shows how to use this syntax in practice.

Example: Use VLOOKUP to Return All Matches

Suppose we have the following dataset in Excel that shows information about various basketball teams:

Suppose we use the following formula with VLOOKUP to look up the team “Rockets” in column A and return the corresponding points value in column C:

=VLOOKUP(E2, A2:C11, 3)

The following screenshot shows how to use this formula in practice:

The VLOOKUP function returns the value in the “Points” column for the first occurrence of Rockets in the “Team” column, but it fails to return the points values for the other two rows that also contain Rockets in the “Team” column.

To return the points values for all rows that contain Rockets in the “Team” column, we can use the FILTER function instead.

Here’s the exact formula we can use:

=FILTER(C2:C11, E2=A2:A11)

The following screenshot shows how to use this formula in practice:

Notice that the FILTER function returns all three points values for the three rows where the “Team” column contains Rockets.

Related: Excel Advanced Filter: How to Use “Contains”

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

How to Compare Two Lists in Excel Using VLOOKUP
How to Find Unique Values from Multiple Columns in Excel
How to Filter Multiple Columns in Excel

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories