11.1 C
London
Sunday, July 7, 2024
HomeSoftware TutorialsExcelHow to Compare Two Lists in Excel Using VLOOKUP

How to Compare Two Lists in Excel Using VLOOKUP

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...

You can use the following basic formula to compare two lists in Excel using the VLOOKUP function:

=ISNA(VLOOKUP(A2,$C$2:$C$9,1,False))

Using the Conditional Formatting tool in Excel, we can use this formula to highlight every value in column A that does not belong to a range in column C.

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

Example: Compare Two Lists Using VLOOKUP

Suppose we have the following two datasets in Excel:

Suppose we’d like to identify the teams in Dataset 1 that are not in Dataset 2.

To do so, we can highlight every value in column A and then click the Conditional Formatting button on the Home tab along the top ribbon.

We can then click New Rule…

In the new window that appears, select the option that says Use a formula to determine which cells to format then type in the following formula:

=ISNA(VLOOKUP(A2,$C$2:$C$9,1,False))

Then click the Format button and choose a color to fill in values:

Once you click OK, every value in column A that does not appear in column C will be highlighted:

We can manually verify that a few of the values are highlighted correctly:

  • Hawks appear in both Dataset 1 and Dataset 2, so it is not highlighted.
  • Mavericks appear in both Dataset 1 and Dataset 2, so it is not highlighted.
  • Lakers appear in Dataset 1 but not Dataset 2, so it is highlighted.

And so on.

Note that we chose to highlight values that did not belong to both datasets, but we could also apply a different styling such as bolded text, increased font size, a border around cells, etc.

Additional Resources

How to Compare Two Excel Sheets for Differences
How to Calculate the Difference Between Two Dates 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