The fastest way to compare two columns
The simplest method is to create a formula in a third column that shows whether the values match. In a new column next to your data, type =A1=B1 (replacing A and B with your actual column letters). Press Enter. Excel returns TRUE if the cells match and FALSE if they don't. Copy this formula down the entire length of your data by clicking the cell and dragging the small square at its bottom-right corner down to the last row.
This approach works for any data type — text, numbers, dates — and takes seconds to set up. You can see at a glance which rows have differences and which don't. If you have 500 rows, you'll see 500 TRUE or FALSE results when ready.
For a more visual result, you can add conditional formatting to highlight the differences instead of showing TRUE/FALSE. Select your comparison column, go to Home > Conditional Formatting > Highlight Cell Rules > Equal To, and choose a color. Cells that don't match will stand out in that color.
Key Takeaways
- A formula like =A1=B1 in a third column shows TRUE for matching rows and FALSE for differences, and you can copy it down to compare hundreds of rows at once.
- Conditional formatting adds color to non-matching cells so differences jump out visually without needing a separate column.
- The COUNTIF function lets you count how many cells in one column appear anywhere in another column, useful when order doesn't matter.
- Sorting both columns the same way before comparing makes it easier to spot patterns in what's different.
When you need to find values that exist in one column but not the other
Sometimes you don't care whether rows match — you want to know if a value from Column A appears anywhere in Column B at all. Use the COUNTIF function for this. In a new column, type =COUNTIF($B$B:$B$1000,A1) (adjust the range to match your data size). This counts how many times the value in A1 appears in Column B. If the result is 0, that value doesn't exist in Column B.
The dollar signs ($) lock the column range so it doesn't change when you copy the formula down. Copy this formula to all rows in Column A. Any row showing 0 means that value is unique to Column A.
You can reverse this to find values in Column B that don't appear in Column A — just swap the columns in the formula.
Comparing columns when the data is in different order
If your two columns contain the same values but in different rows, a straightforward TRUE/FALSE comparison won't work. Instead, sort both columns the same way first. Select each column separately, go to Data > Sort A to Z (or Z to A), and explore the same sort order to both. Once they're in the same order, the TRUE/FALSE formula method works perfectly.
If you can't sort the data because it would break other information in your spreadsheet, use COUNTIF instead. It finds matches regardless of row position, so you'll see which values exist in both columns even if they're in completely different orders.
Using built-in comparison tools for larger datasets
Excel has a feature called Go To Special that can highlight differences between two selected ranges. Select both columns (hold Ctrl and click each one), then press Ctrl+\ (backslash). Excel highlights any cells that are different. This works best when your columns are the same size and roughly aligned.
For very large datasets with thousands of rows, formulas are usually faster than manual selection tools. A formula calculates across your entire dataset in seconds, while selection-based tools require you to manually mark ranges and can be slower on huge files.
Handling text that looks the same but isn't
Sometimes a comparison shows FALSE even though the values appear identical. This usually means one cell has extra spaces, different capitalization, or hidden characters. Use the TRIM function to remove leading and trailing spaces: =TRIM(A1)=TRIM(B1). For capitalization differences, wrap both sides in UPPER: =UPPER(A1)=UPPER(B1).
If you still see FALSE after using TRIM and UPPER, the cells likely contain different characters that look the same on screen. Copy one value into a text editor and look for unusual spacing or symbols. Once you identify the problem, you can use Find & Replace (Ctrl+H) to clean up the data before comparing again.
Saving your comparison results
After you've compared your columns and found the differences, you may want to keep a record of what you found. Copy your comparison column (the one with TRUE/FALSE or the COUNTIF results) and paste it as values only in a new sheet. Go to Edit > Paste Special > Values, which removes the formulas and leaves only the results. This way, if you change the original data later, your comparison results stay frozen in place.
You can also filter your data to show only the FALSE or 0 results. Click the column header, go to Data > Filter, and click the dropdown arrow. Uncheck TRUE (or any non-zero numbers) to show only the rows that don't match. This makes it straightforward to focus on just the differences.
Frequently Asked Questions
Can I compare more than two columns at once?
Yes. Use a formula like =AND(A1=B1,B1=C1,C1=D1) to check if all four columns match. This returns TRUE only if every column in that row is identical. You can add as many column comparisons as you need by adding more conditions separated by commas.
What if my columns have different data types, like one is text and one is a number?
Excel usually handles this automatically, but if you get unexpected FALSE results, convert both to the same type first. Wrap numbers in TEXT: =TEXT(A1,"0")=B1. Or convert text to numbers using VALUE: =A1=VALUE(B1). Test with a few rows first to make sure the conversion works the way you expect.
How do I compare two columns in different sheets?
Reference the other sheet in your formula. If Sheet1 has Column A and Sheet2 has Column B, type =Sheet1!A1=Sheet2!B1 in a cell on either sheet. The exclamation mark tells Excel to look in a different sheet. Copy this formula down just like you would for columns on the same sheet.
Can I highlight entire rows that don't match instead of just the cells?
Yes, using conditional formatting with a formula. Select all your data, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter =A1<>B1 (the <> symbol means "not equal to"). Choose your highlight color. Excel will shade the entire row based on whether Column A and Column B match in that row.
What's the difference between = and ==?
In Excel, use a single equals sign (=) for comparisons. The double equals sign (==) is used in some programming languages but not in Excel formulas. A single = is correct for all comparison operations in Excel.