To compare two columns in Excel, the fastest method is using a simple logical formula like =A2=B2, which returns TRUE if the cells match and FALSE if they do not. Depending on your goal—whether you want to highlight differences, extract a list of unique values, or find missing data across thousands of rows—you can use Conditional Formatting, the VLOOKUP function, or the EXACT function for case-sensitive comparisons. This process allows you to audit data integrity, reconcile two different lists, and clean up spreadsheets by identifying duplicates or discrepancies.

What You'll Need

  • Microsoft Excel (any modern version, including Office 365, Excel 2021, 2019, or 2016).
  • A dataset with at least two columns of data to be compared.
  • Basic familiarity with how to select cells and enter formulas.

Step-by-Step

Depending on your specific needs, choose one of the following four methods. Note that menu labels may differ slightly depending on your version of Excel, your operating system, or your regional language settings.

Method 1: Simple Logical Comparison (Best for Row-by-Row Checks)

Use this method when you have two columns side-by-side and you want to know if the value in Row 2 of Column A is exactly the same as the value in Row 2 of Column B.

  1. Ensure your two columns are adjacent (e.g., Column A and Column B).
  2. Click on the first empty cell in the column next to your data (e.g., Cell C2).
  3. Type the formula =A2=B2 and press Enter.
  4. If the values match, Excel will display TRUE. If they differ, it will display FALSE.
  5. Hover your mouse over the bottom-right corner of cell C2 until the cursor turns into a small black cross (the Fill Handle).
  6. Double-click the Fill Handle or drag it down to the bottom of your dataset to apply the comparison to all rows.

Method 2: Conditional Formatting (Best for Visual Highlighting)

Use this method to visually flag cells that are duplicates or unique without adding a new column of formulas.

  1. Highlight both columns you wish to compare by clicking and dragging across the headers.
  2. Go to the Home tab on the top ribbon.
  3. Click on Conditional Formatting in the Styles group.
  4. Select Highlight Cells Rules and then click Duplicate Values....
  5. In the dialog box that appears, use the drop-down menu on the left to choose either Duplicate (to see what is in both lists) or Unique (to see what is different).
  6. Select your preferred highlight color from the drop-down menu on the right (e.g., Light Red Fill with Dark Red Text).
  7. Click OK. The matching or differing cells will now be colored automatically.

Method 3: The VLOOKUP Function (Best for Unsorted Lists)

Use this method when you need to check if a value from Column A exists anywhere in Column B, even if it is not on the same row.

  1. Click in an empty cell next to your first data entry (e.g., Cell C2).
  2. Enter the formula: =VLOOKUP(A2, B:B, 1, FALSE).
  3. Breakdown of this formula: A2 is the value you are looking for; B:B is the column you are searching in; 1 tells Excel to return the value from the first column of the range; FALSE ensures it only looks for an exact match.
  4. Press Enter. If the value exists in Column B, the value itself will appear. If it does not exist, Excel will return a #N/A error.
  5. To make this cleaner, wrap it in an IFERROR function: =IFERROR(VLOOKUP(A2, B:B, 1, FALSE), "Not Found").
  6. Drag the Fill Handle down to complete the list.

Method 4: The EXACT Function (Best for Case-Sensitive Comparison)

Standard Excel formulas ignore capitalization (e.g., "Apple" is seen as the same as "apple"). Use EXACT if capitalization matters.

  1. Click in an empty cell (e.g., Cell C2).
  2. Type the formula =EXACT(A2, B2) and press Enter.
  3. The function will return TRUE only if the text is identical, including the casing.
  4. Drag the formula down to the end of your data set.

Common Mistakes

  • Ignoring Leading or Trailing Spaces: This is the most common cause of "false negatives." A cell containing "Apple " (with a space at the end) will not match a cell containing "Apple". To fix this, use the =TRIM() function to remove extra spaces before comparing.
  • Comparing Different Data Types: Excel treats numbers stored as text differently than actual numbers. If one column is formatted as "Text" and the other as "Number," the comparison will return FALSE even if the digits look identical.
  • Using the Wrong VLOOKUP Range: When using VLOOKUP, if you select a specific range (like B2:B100) instead of the whole column (B:B), you must use absolute references ($B$2:$B$100). Otherwise, the range will shift downward as you drag the formula, leading to missing matches.
  • Overlooking Case Sensitivity: Using =A2=B2 for passwords or case-sensitive IDs will lead to errors because it ignores capitalization. Always use EXACT() for these scenarios.

Tips

  • Use Tables: Convert your data range into an official Excel Table (Ctrl + T). When you add a formula to a table column, Excel automatically fills the formula down to the bottom, saving you from manual dragging.
  • Filter the Results: After using Method 1 or Method 3, apply a Filter (Data > Filter). You can then filter the results column to show only "FALSE" or "#N/A" values, allowing you to focus only on the discrepancies.
  • Combine with IF: Instead of TRUE/FALSE, make your results more readable. Use =IF(A2=B2, "Match", "Mismatch") to get custom labels.
  • Sort First: If you are doing a manual visual check, sort both columns alphabetically. This makes it significantly easier to spot where a list diverges.

Troubleshooting

If your comparison is not working as expected, try these steps in order:

  1. Check for Hidden Characters: Use the =LEN() function on both cells. If one cell says "Apple" (5 letters) and the other says "Apple" but the LEN function returns 6, there is a hidden space or non-printing character. Use =TRIM(CLEAN(A2)) to resolve this.
  2. Standardize Formatting: Select both columns, go to the Home tab, and change the Number Format dropdown to General. This ensures you aren't comparing a date formatted as a number against a date formatted as text.
  3. Verify Formula References: If your results seem "shifted," check that your formula starts on the same row as your data. If your data starts on row 2, your formula must be =A2=B2, not =A1=B1.
  4. Recalculate the Sheet: If you changed data but the TRUE/FALSE results didn't update, your workbook might be set to Manual Calculation. Go to Formulas > Calculation Options and select Automatic.

Frequently Asked Questions

How do I compare two columns and pull the differences into a new list?

The most efficient way is to use the VLOOKUP method described above. Once you have the "Not Found" or "#N/A" results, apply a filter to that column to show only the mismatches. You can then copy and paste those filtered rows into a new sheet.

Can I compare columns across two different worksheets?

Yes. When writing your formula, instead of clicking a cell in the same sheet, click over to the second sheet and select the cell. The formula will look like =A2='Sheet2'!A2. Excel will automatically handle the sheet referencing.

Is there a way to compare columns without using formulas?

Yes, Conditional Formatting is the best non-formula method. By selecting both columns and using the "Duplicate Values" rule, you can visually identify differences instantly without writing any code.

How do I find values that are in Column A but NOT in Column B?

Use the formula =ISNA(MATCH(A2, B:B, 0)). This will return TRUE if the value in A2 cannot be found anywhere in Column B, effectively identifying the missing entries.

Why does Excel say two cells are different when they look identical?

This is usually due to trailing spaces, hidden formatting, or data type mismatches (Number vs. Text). Use the TRIM function or check the cell formatting in the Home tab to ensure both columns are the same type.