Comparing two columns of data in Excel is most quickly achieved using a simple logical formula like =A2=B2 for row-by-row checks, or the VLOOKUP and MATCH functions for finding data regardless of its position. This process allows you to identify duplicates, find missing entries, and ensure data integrity across two different lists, such as comparing a master client list against a monthly mailing list.

What You'll Need

  • Microsoft Excel (any modern version, including Office 365, Excel 2021, 2019, or 2016).
  • Two columns of data that you wish to compare (e.g., Column A and Column B).
  • A clean worksheet with enough empty columns to the right of your data to house the comparison formulas.

Step-by-Step

Depending on whether you want to find exact row-by-row matches or find if a value in one list exists anywhere in the second list, you will use different methods. Note that menu labels may differ slightly depending on your version of Excel or region.

Method 1: Row-by-Row Comparison (The Exact Match)

Use this method when the data in both columns is supposed to be in the same order and you want to see if the values in the same row are identical.

  1. Click on the first empty cell in the column next to your data (for example, cell C2 if your data is in A2 and B2).
  2. Type the formula =A2=B2 and press Enter.
  3. Excel will return TRUE if the cells are identical and FALSE if they are different.
  4. To apply this to the rest of your list, click the small green square (the fill handle) at the bottom-right corner of cell C2 and drag it down to the end of your data set.
  5. (Optional) To make the results more readable, use an IF statement: =IF(A2=B2, "Match", "Mismatch"). This replaces the True/False logic with custom text.

Method 2: Conditional Formatting (The Visual Highlight)

Use this method to instantly highlight cells that are duplicates or unique across two columns without creating a new column of formulas.

  1. Select both columns of data by clicking and dragging across the column headers (e.g., click 'A' and drag to 'B').
  2. Go to the Home tab on the top ribbon.
  3. Click on Conditional Formatting in the Styles group.
  4. Hover over Highlight Cells Rules and select Duplicate Values....
  5. In the dialog box that appears, the first dropdown will default to "Duplicate". You can change this to "Unique" if you only want to see the differences.
  6. Choose your preferred highlight color from the second dropdown (e.g., Light Red Fill with Dark Red Text).
  7. Click OK. All cells that appear in both columns will now be highlighted.

Method 3: Finding Values Across the Entire List (VLOOKUP/MATCH)

Use this method when your data is not sorted in the same order. This checks if a value in Column A exists anywhere in Column B.

  1. Click in cell C2.
  2. Enter the following formula: =IF(ISERROR(MATCH(A2, B:B, 0)), "Not Found", "Found").
  3. Breakdown of this formula: MATCH(A2, B:B, 0) looks for the value of A2 anywhere in Column B. If it doesn't find it, it returns an error. ISERROR catches that error, and IF converts it into a readable "Not Found" or "Found" label.
  4. Press Enter and drag the fill handle down to the bottom of your list.
  5. You now have a list that tells you exactly which items from your first column are missing from the second.

Common Mistakes

Many users find that their formulas return "FALSE" or "Not Found" even when the data looks identical. This is usually caused by hidden data inconsistencies rather than a formula error.

Leading or Trailing Spaces: This is the most common culprit. If Cell A2 contains "Apple" and Cell B2 contains "Apple " (with a space at the end), Excel treats them as completely different values. To fix this, use the TRIM function to remove extra spaces: =TRIM(A2)=TRIM(B2).

Data Type Mismatches: Excel distinguishes between numbers and text. If Column A contains the number 100 (stored as a number) and Column B contains 100 (stored as text), the comparison will fail. You can tell if a number is stored as text if there is a small green triangle in the top-left corner of the cell.

Case Sensitivity: By default, the = and MATCH functions are not case-sensitive. "APPLE" and "apple" are considered the same. If you need to distinguish between uppercase and lowercase, you must use the EXACT function: =EXACT(A2, B2).

Incorrect Range References: When using MATCH or VLOOKUP, users often select a specific range (like B2:B100) instead of the whole column (B:B). If you drag the formula down without using absolute references (the dollar signs, e.g., $B$2:$B$100), the search range shifts downward, and you will miss matches at the top of your list.

Tips

Use Tables for Dynamic Data: Convert your data ranges into official Excel Tables by selecting your data and pressing Ctrl + T. When you add new rows to a Table, your comparison formulas will automatically extend to the new data, saving you from having to drag the fill handle manually every time.

Filter by Color: After using Conditional Formatting to highlight duplicates, you can quickly isolate them. Click the filter arrow in your column header, select Filter by Color, and choose the highlight color you applied. This creates a clean list of only the matching or unique items.

The Power of the TRIM Function: If you are dealing with data imported from external software or websites, it is a best practice to create a "cleaned" version of your columns first. Use =TRIM(CLEAN(A2)) in a new column to remove both invisible non-printable characters and extra spaces before performing your comparison.

Sorting for Visual Verification: If you have a small enough dataset, sorting both columns alphabetically (A to Z) can make manual verification much easier. However, be careful: if you are using the row-by-row =A2=B2 method, sorting one column but not the other will break your results.

Troubleshooting

If your comparison is not producing the expected results, follow these steps in order of simplicity:

  1. Check for Hidden Spaces: Select a cell that should be a match, go to the formula bar, and click at the end of the text to see if the cursor is blinking right against the last letter or if there is a gap. Use the TRIM function if gaps exist.
  2. Unify Data Formats: Select both columns, go to the Home tab, and change the Number Format dropdown to "General". If some numbers still have that green triangle, select the cells, click the warning icon, and select "Convert to Number".
  3. Verify Absolute References: If you are using a range like B2:B500 in a MATCH formula, ensure it is written as $B$2:$B$500. Without the dollar signs, Excel changes the range to B3:B501, B4:B502, and so on, as you drag the formula down.
  4. Check for Hidden Rows: Ensure you haven't accidentally filtered your data or hidden rows, which might make it look like the formula is skipping cells when it is actually calculating them correctly in the background.
  5. Restart the Calculation: If formulas aren't updating, go to the Formulas tab, click Calculation Options, and ensure "Automatic" is checked.

Frequently Asked Questions

Can I compare two columns on different worksheets?

Yes. When writing your formula, instead of clicking a cell in the same sheet, click the other worksheet tab and select the cell or column. The formula will look like =A2='Sheet2'!A2.

How do I find only the values that are NOT in both columns?

Use Conditional Formatting and select "Unique" instead of "Duplicate" in the dropdown menu. Alternatively, use the MATCH formula and filter for the "Not Found" results.

Is there a way to compare columns without using formulas?

Yes, the Conditional Formatting method is the best non-formula approach. For more advanced users, the "Remove Duplicates" tool under the Data tab can be used, but be careful as this deletes data rather than just identifying it.

Does Excel have a built-in "Compare" button?

Excel does not have a single "Compare" button for columns. You must use the logical operators, conditional formatting, or lookup functions described above to achieve this.

How do I compare three or more columns?

For row-by-row checks, you can nest your logic: =AND(A2=B2, B2=C2). This will return TRUE only if all three cells in that row are identical.

Why does my VLOOKUP return #N/A?

The #N/A error simply means the value was not found in the search range. To hide this and make your sheet look cleaner, wrap your formula in =IFERROR(your_formula, "Not Found").