You need to compare two lists of values. How would you do it in Excel?

Comparing Two Lists of Values in Excel

If you have two lists and need to compare them, Excel offers multiple methods depending on the complexity of your data and the type of comparison required.


1. Using Conditional Formatting (Highlight Differences & Matches)

If you want to visually compare two lists and highlight matches or differences:

Steps :
  1. Select the first list (A2:A10).
  2. Go to HomeConditional FormattingNew RuleUse a formula to determine which cells to format.
  3. Enter the formula:
    =COUNTIF($B$2:$B$10, A2) = 0
    
    • This highlights values in A2:A10 that are not in List B.
  4. Click Format, choose a highlight color, and press OK.
  5. Repeat for List B by changing the formula to:
    =COUNTIF($A$2:$A$10, B2) = 0
    
    • This highlights values in B2:B10 that are not in List A.

* Best for: Quick visual comparison of lists.


2. Using COUNTIF to Find Matches or Differences

If you need a clear TRUE/FALSE result in a helper column:

Steps :
  1. In column C, use this formula next to values in List A:
    =IF(COUNTIF(B:B, A2) > 0, "Match", "No Match")
    
    • This checks if A2 exists in List B.
  2. Drag the formula down.
  3. Reverse it for List B if needed.

* Best for: Easily filtering and sorting results.


3. Using VLOOKUP to Find Missing Values

If you want to return a message when values in List A don’t exist in List B:

Steps :
  1. In column C, use this formula:
    =IF(ISNA(VLOOKUP(A2, B:B, 1, FALSE)), "Not in List B", "Found in List B")
    
  2. Drag the formula down.

* Best for: Checking presence in another list while avoiding errors.


4. Using MATCH to Compare Lists

If you want to check if values in List A exist in List B without using extra columns:

Steps :
  1. Use this formula:
    =IF(ISNUMBER(MATCH(A2, B:B, 0)), "Exists", "Missing")
    
  2. Drag the formula down.

* Best for: Exact matches without retrieving additional data.


5. Using Power Query for Advanced Comparisons

For large datasets, Power Query is more efficient.

Steps :
  1. Select List A → Go to DataGet & TransformFrom Table/Range.
  2. Repeat for List B.
  3. In Power Query, merge queries on the common column.
  4. Choose Left Anti Join to find missing values.
  5. Load the results back to Excel.

* Best for: Comparing thousands of records efficiently.


Best Method Based on Your Needs :
Method Best For
Conditional Formatting Highlighting differences visually
COUNTIF Formula Checking if values exist in another list
VLOOKUP Finding missing values with custom messages
MATCH Function Quick comparison without extra columns
Power Query Large datasets and complex comparisons