how to compare two columns in excel

How to Compare Two Columns in Excel?

April 7th, 2026
3724
15:00 Minutes

Comparing two columns in Excel may sound like a simple task, but it quickly becomes challenging when you’re dealing with large datasets, repeated values or small mismatches that are easy to overlook. Whether you are checking customer lists, validating reports, or auditing business data, knowing how to compare two columns in Excel is an essential skill.

In this Excel tutorial, you’ll learn how to compare two columns in Excel using practical, real-world methods. We’ll explore everything from basic formulas for finding matches and mismatches to more advanced lookup techniques for identifying duplicates and inconsistencies. By the end of this guide, you’ll be able to confidently validate, clean, and audit your data, saving time and avoiding costly errors in your analysis and reports.

Master Advanced Excel with Expert Training

Boost your skills in data analysis, formulas, and automation.

Explore Now

Quick Solution: Compare Two Columns in Excel

If you are looking for the fastest way to compare two columns in Excel, this simple formula-based method is the easiest place to start. It works well for small to medium datasets where values are aligned row by row, and you just want a quick yes-or-no comparison. While this approach is not ideal for complex data validation, it helps you instantly spot matches and mismatches without any advanced Excel knowledge.

Method 1: Comparing Two Columns in Excel Using the Equals Operator

Here’s how to compare two columns in Excel using quick steps:

1. Click on cell C2, insert the following formula, and hit the enter button.

=A2=B2

how to compare two columns in excel using the equal operator

2. Drag the formula down to other rows. Excel will return TRUE if the values in both columns match and FALSE if they don’t. This quick solution is perfect when you need immediate results, but for larger datasets or deeper analysis, more efficient and advanced methods are discussed in the next sections.

how to compare two columns in excel using the equal operator

Master Excel Dashboard Training with Expert Guidance

Boost your skills in creating interactive dashboards and visual reports.

Explore Now

Advanced Methods to Compare Two Columns in Excel

Excel offers several comparison methods, each with different advantages depending on the complexity of the data you have at hand. You need to know every method to become a proficient data professional. Let's explore all of these methods one by one:

Method 2: Comparing Two Columns in Excel Using the IF() Function

1. Click on cell C2, insert the following formula and hit the enter button.

=IF(A2=B2,"Match","Not Match")

how to compare two columns in excel using the if function

2. Drag the formula down to other rows. The following results you will get:

  • Match: names are the same.
  • Not Match: names are different.

how to compare two columns in excel using the if function

Method 3: Comparing Two Columns in Excel Using the EXACT() Function

1. Click on cell C2, insert the following formula and hit the enter button.

=EXACT(A2,B2)

how to compare two columns in excel using the exact function

2. Drag the formula cell down to make the same changes in other cells. What will happen:

  • TRUE: exactly the same (including capital letters)
  • FALSE: anything different

Unlike the equals (=) operator, the EXACT() function is case-sensitive. The equals operator ignores uppercase and lowercase differences, but EXACT() treats "Excel" and "excel" as different values.

how to compare two columns in excel using the exact function

Method 4: Comparing Two Columns in Excel with the VLOOKUP() function

1. Click on C2 and type the following formula:

=IF(ISNA(VLOOKUP(A2,B:B,1,FALSE)),"Not Found","Found")

how to compare two columns in excel using the vlookup function

2. Drag the formula cell to the last row of data and your sheet will look like this:

how to compare two columns in excel using the vlookup function

Note: Using entire column references like A:A or B:B is generally safe in modern versions of Excel. However, in very large datasets (100,000+ rows) or when using complex formulas, limiting the range to specific rows (for example B2:B5000) can improve performance.

Method 5: Comparing Two Columns in Excel Using XLOOKUP()

If you are using Excel 365 or Excel 2021 and later versions, XLOOKUP is a more powerful and flexible alternative to VLOOKUP. It is easier to use and does not require column index numbers.

1. Click on cell C2 and type the following formula:


=IF(ISERROR(XLOOKUP(A2,B:B,B:B)),"Not Found","Found")

comparing two columns in excel using xlookup

2. Press Enter and drag the formula down.

Excel will return:

  • Found → if the value exists in column B
  • Not Found → if the value does not exist


XLOOKUP is recommended for modern Excel users because it is more efficient and flexible than VLOOKUP.

Method 6: Comparing Two Columns in Excel Using Conditional Formatting

  • Highlight Matching Names

1. Select column A from A2 to wherever your data ends.

comparing two columns using conditional formatting

2. Go to Home → Conditional Formatting → New Rule → Use a formula to determine which cells to format. Enter the following formula:

comparing two columns using conditional formatting

3. Click Format, choose a highlight color, and press OK. Now Excel will highlight values in column A that also exist in column B.

comparing two columns using conditional formatting

Read Also: How to Remove Blank Rows in Excel?

How to Compare Two Columns in Excel for Duplicates?

Finding duplicates is another reason why we will have to compare two columns in Excel. Well, it is a part of data cleansing methods that include using different formulas. let's understand how:

Method 7: Compare Two Columns using IF() + MATCH()

1. Click on C2 and type the following formula and press the Enter button.

=IF(ISNUMBER(MATCH(A2,B:B,0)),"Duplicate","Not Duplicate")

comparing columns using if mach functions

2. Now Click on C2, drag the small blue square (fill handle) down to the last row. Now each row is checked automatically using the applied formula just like the reference image:

how to compare two columns in excel using the if match function

Method 8: Compare Two Columns using COUNTIF()

1. Click on C2 and type this formula and press the enter button:

=IF(COUNTIF(B:B,A2)>0,"Duplicate","Not Duplicate")

how to compare two columns in excel using the countif function

2. Click on C2 and drag the small blue square down. Your data will look like this:

how to compare two columns in excel using the countif function

Method 9: Using FILTER() to Show Missing Values (Excel 365)

In Excel 365, you can use dynamic array formulas to directly extract values that are missing in another column.

To show values in Column A that do not exist in Column B:

=FILTER(A:A,ISNA(MATCH(A:A,B:B,0)))

This formula automatically returns a list of values that are present in Column A but missing in Column B.


The FILTER function is useful when you want a separate clean list of unmatched values instead of just labeling rows.

Method 10: Comparing Two Columns Using Power Query (Best for Large Data)

For very large datasets, Power Query is the most professional and reliable way to compare columns.

1. Select your data and convert it into a Table (Ctrl + T).

comparing two columns using power query

2. Go to Data → Get & Transform → From Table/Range.

3. Load both columns into Power Query.


4. Use the Merge Queries option.


5. Choose Join type:

  • Left Anti Join → shows values not present in the second column
  • Inner Join → shows matching values


Power Query is recommended when working with thousands or millions of rows because it handles large data more efficiently than formulas.

How to Choose the Right Method to Compare Two Columns in Excel

One question I often get from Excel beginners is: “Which comparison method should I use?” The truth is that there is no single method that works best in every situation. Over the years, I have used different comparison techniques depending on the size of the dataset, the type of analysis required, and the version of Excel available. Choosing the right method can save a lot of time and help you avoid unnecessary complexity.

Whenever I need to compare two columns, I first identify the goal of the comparison. Am I simply checking whether two cells match? Looking for duplicate values? Finding missing records? Or working with a large dataset containing thousands of rows? The answer usually determines which Excel feature I choose.

Your Goal Recommended Method Why I Recommend It
Quick row-by-row comparison Equals Operator (=A2=B2) Fastest and easiest method for checking whether corresponding cells contain the same value.
Create easy-to-read results IF() Function Displays clear outputs such as “Match” or “Not Match,” making reports easier to understand.
Perform case-sensitive comparisons EXACT() Function Useful when uppercase and lowercase letters must be treated differently.
Find values that exist in another column XLOOKUP() or VLOOKUP() Ideal when the lists are not aligned row by row and you need to search for matches.
Identify duplicate values COUNTIF() or MATCH() Quickly detects repeated records between two columns.
Visually highlight matches or differences Conditional Formatting Excellent for audits and reviews because results are instantly visible.
Extract unmatched records FILTER() Function Creates a separate list of missing values without manually reviewing the dataset.
Compare thousands of rows efficiently Power Query Handles large datasets much better than formulas and is easier to maintain over time.

Personally, when I am working with small datasets, I usually start with the IF() function or Conditional Formatting because they are simple and provide immediate feedback. For larger datasets, I prefer XLOOKUP or Power Query because they are more scalable and reduce the chances of manual errors. If I only need a quick answer, the equals operator remains one of the fastest tools available.

My advice is to begin with the simplest method that solves your problem. As your Excel skills improve and your datasets become larger, you can gradually move to more advanced tools such as XLOOKUP, FILTER, and Power Query. This approach keeps your spreadsheets easier to understand while still delivering accurate results.

Common Errors While Comparing Columns in Excel

When I was a beginner like you and started comparing two columns in Excel. I thought I could do it easily, but I missed matches and made small mistakes, which taught me how common errors can affect the final results. Following are some of the common mistakes that I want you to avoid:

1. Different data formats: Values may look the same, but differences in text, numbers or dates can cause wrong results.

2. Extra spaces in cells: Hidden spaces before or after values often lead to missed matches.

3. Using the wrong formula: Choosing an incorrect formula can show false matches or errors.

4. Case sensitivity issues: Excel treats uppercase and lowercase text differently in some functions.

5. Not checking for duplicates: Duplicate values can confuse comparisons and lead to inaccurate conclusions.

Read Also: Excel Formulas Everyone Needs to Know

Key Things to Know for Comparing Two Columns in Excel

I have seen many people who jump straight into formulas, and then they get confused by the results later. If you clearly understand your goal and prepare your data properly, comparing columns becomes easy. Here are some key things that you need to know before you start comparing Excel columns:

1. Ensure Data Consistency and Compatibility

Even when the data looks the same, Excel may not read it the same way. Small differences like formatting or spacing can cause problems when you compare columns. The following are some key aspects that you should always remember:

  • Data type consistency (text vs numbers).
  • Extra spaces before or after values.
  • Date formats are stored differently.
  • Case sensitivity, where applicable.

For cleaning and standardizing data before comparison, you can use tools like TRIM or VALUE.

2. Determine Whether Row Alignment Is Required

Every column comparison does not follow the same structure. In some cases, values must be compared row by row, while in others, the position of the data does not matter. There are two primary scenarios:

  • Row-by-row comparison: Each row in one column corresponds directly to the same row in another column.
  • Unordered list comparison: Values are compared across columns regardless of their position.

3. Identify and Manage Duplicate Values

Duplicate entries can affect the reliability of comparison results, especially when using lookup functions that return only the first match. When you start comparing, always make sure that:

  • You check for duplicate values
  • Decide how duplicates should be handled
  • Remove or manage duplicates where necessary

Master Microsoft Certifications with Expert Training

Boost your Excel knowledge and advance your tech career.

Explore Now

Wrapping Up

Comparing two columns in Excel doesn’t have to be confusing or time-consuming. In this article, you explored multiple ways to compare data from simple formulas to built-in Excel tools. Each method helps you in spotting matches, differences, duplicates, or missing values. All this, more accurately and with less effort. All the methods that are explained here follow standard Excel practices and are aligned with Microsoft’s recommended approach to data comparison and validation.

Now, your next step has to be practice. Try these methods on real files, even small ones. As your data grows, try to choose smarter techniques instead of manual checks. Over time, you will not only save hours but also avoid costly mistakes. Mastering this skill makes your Excel work cleaner, faster, and far more reliable.

FAQs

Q1. What is the importance of comparing two columns in Excel?

Comparing two columns helps you quickly check if the data is the same or different. It makes it easy to find duplicate values, missing entries or matching data between two lists.

Q2. What is the difference between the one-time purchase version of Excel and Microsoft 365?

The one-time purchase version of Excel (such as Office 2021 or Office 2024) is bought once and does not receive major feature updates.  Microsoft 365 is subscription-based and receives regular updates, new functions like XLOOKUP and dynamic array formulas, and security improvements automatically.

Q3. How do I compare two columns in Excel without using formulas?

To compare two columns in Excel without using formulas, you can use Conditional Formatting. It highlights matching or different values automatically.

Q4. What is the latest version of Microsoft Excel?

Microsoft 365 is the latest version. It is a subscription-based version that gets regular updates, new features and security improvements automatically.

Q5. Is the COUNTIF method best for beginners?

Yes, COUNTIF is best for beginners. It is easy to learn and does not require complex formulas.

Q6. Why do two values look the same, but Excel says they’re different?

This happens because Excel stores values with hidden differences like extra spaces, non-breaking spaces or different data types (text vs number) even if they look identical.

About the Author
Sanjay Prajapat
About the Author

Sanjay Prajapat is a Data Engineer and technology writer with expertise in Python, SQL, data visualization, and machine learning. He simplifies complex concepts into engaging content, helping beginners and professionals learn effectively while exploring emerging fields like AI, ML, and cybersecurity in today’s evolving tech landscape.

Drop Us a Query
Fields marked * are mandatory
×

Your Shopping Cart


Your shopping cart is empty.