How to Compare Two Columns in Excel? (4 Easy Methods)

How to Compare Two Columns in Excel? (4 Easy Methods)

6 mins readComment
Rashmi
Rashmi Karan
Manager - Content
Updated on Nov 6, 2024 10:17 IST

MS Excel spreadsheets are useful for data storage, manipulation, and decision-making. Since such spreadsheets are huge and often multiple spreadsheets are linked to one another. In that case, manually comparing columns is a tedious task. It might take hours or days to find the missing data. Knowing certain functions that facilitate tasks and optimise your productivity is necessary. In this blog, we will cover how to compare two columns in Excel.

How to Compare Two Columns In Excel

Depending on your specific goal, you can use various methods to compare columns with rows with the same data in Excel. Here's how you can do it:

Table of Content

Compare Two Columns In Excel Using the โ€œEqualโ€ Function

The Equal function compares values row by row to identify exact matches. Here are the steps involved:

Step 1 - Identify the two columns you want to compare. In this case, we are tallying two tables

Step 2 - Insert a new column next to the columns you want to compare. This column will display the comparison results.

Step 3 - Click on the first cell of the new column (e.g., in our case, it is Column C; click on C3).

Step 4 - Enter the EQUAL formula to compare the values in the corresponding cells in the two tables with data in Column B. We will use the below formula -

=B3=B16

Equal function 1

Step 5 - Press Enter to apply the formula to the cell.

Equal function 2

Step 6 - Drag the fill handle down the column to apply the formula to all rows you want to compare.

Equal function 3

The new column will display TRUE if the values in the corresponding cells in Column B are identical and FALSE if they differ.

Recommended online courses

Best-suited MS Excel courses for you

Learn MS Excel with these high-rated online courses

โ‚น5.5 K
18 hours
โ‚น3.2 K
28 hours
โ‚น1 L
6 months
โ‚น59.54 K
10 months
โ€“ / โ€“
45 hours
โ‚น4.3 K
2 months
โ‚น1.34 L
300 hours
โ€“ / โ€“
1 month
โ‚น6.4 K
104 hours

Compare Two Columns In Excel Using the โ€œEXACTโ€ Function

You can compare two columns using the EXACT function to determine if the values in corresponding cells are exactly the same. 

Step 1 - Ensure your data is organised with the two columns you want to compare. Let's say Column C contains the values you want to search for in Column G.

Step 2 - Insert a new column where you want the comparison results to appear.  

Step 3 - In the first cell of the new column, enter the following formula:

=EXACT(C3,G3)

Exact Function 1

This formula searches for the value in cell C3 in the entire Column G. If it finds a match, it returns "True"; otherwise, it returns "False".

Step 4 - Drag down the fill handle to copy the formula to all cells in the new column corresponding to the data in Column C.

Exact Function 2

The new column will now display "True" for values in Column C found in Column G and "False" for those not found.

Average Function in Excel โ€“ Formula and Examples
Average Function in Excel โ€“ Formula and Examples
The AVERAGE function is a popular Excel function used for various purposes, such as calculating average sales, average student scores, average monthly expenses, etc. It provides a quick and efficient...read more
COUNT Function in Excel โ€“ Shiksha Online
COUNT Function in Excel โ€“ Shiksha Online
Read on the article to understand how COUNT, COUNTA, and COUNTIF functions work in MS Excel.

How to Compare Two Columns In Excel Using the โ€œIFโ€ Function?

The IF function in Excel allows you to perform conditional checks and display specific outputs based on whether the values in corresponding cells match or not. Here are the steps involved:

Step 1 - Determine which two columns you want to compare. In our example, we want to compare Column C and Column G.

Step 2 - Insert a new column next to the columns you want to compare. This column will display the comparison results.

Step 3 - Click on the first cell of the new column (e.g., if it's Column I, click on I3).

Step 4 - Enter the IF formula to compare the values in the corresponding cells in Columns C and G.

=IF(C3=G3, "Match", "No Match")

IF function 1

This formula checks if the value in cell C3 equals that in cell G3. If they match, it returns "Match"; otherwise, it returns "No Match".

Step 5 - Apply the Formula and press Enter to apply the formula to the cell.

Step 6 - Drag the fill handle down the column to apply the formula to all rows you want to compare.

IF function 2

The new column will display "Match" if the values in the corresponding cells in Columns C and G are identical and "No Match" if they differ.

Compare Two Columns In Excel Using โ€œVLOOKUPโ€

You can compare two columns in Excel using the VLOOKUP function to check if the values in one column exist in the other column. Here's the process to do it:

Step 1 - Ensure your data is organised with the two columns you want to compare. Let's say Column C contains the values you want to search for in Column G.

Step 2 - Insert a new column where you want the comparison results to appear.  

Step 3 - In the first cell of the new column, enter the following formula:

=IF(ISNUMBER(VLOOKUP(C3, G:G, 1, FALSE)), "Match", "No Match")

Vlookup function 1

This formula searches for the value in cell C3 in the entire Column G. If it finds a match, it returns "Match"; otherwise, it returns "No Match".

Step 4 - Drag down the fill handle to copy the formula to all cells in the new column corresponding to the data in Column C.

Vlookup function 2

The new column will now display "Match" for values in Column C found in Column G and "No Match" for those not found.

What is the Purpose of Comparing Two Columns In Excel?

Comparing two columns in Excel serves several purposes:

  1. Identifying Common Information: When you have data in two columns, comparing them helps you identify common points between the two data sets. It comes in handy for finding duplicates, matching records, or consolidating information.
  2. Finding Differences: Besides finding similarities, comparing two columns also helps identify differences. It allows you to pinpoint inconsistencies or missing information.
  3. Data Validation: Comparing columns can be part of a data validation process. You can check if the data in one column matches the expected values in another, ensuring data integrity and accuracy.
  4. Data Cleaning and Formatting: Comparing columns can help in data cleaning tasks, such as standardising formats, correcting errors, or removing redundant information.
  5. Analysing Data Relationships: Comparing columns can reveal relationships between different datasets. For example, you might compare sales data with customer demographics to analyse buying patterns or compare employee performance metrics with training records to assess their performance.

Conclusion

Comparing two columns in Excel can help you identify differences, duplicates, or matching data within a dataset. You can quickly highlight or isolate similarities and discrepancies using the above discussed methods. Mastering these techniques can simplify data analysis, making it easier to spot errors, ensure consistency, or align information across different datasets.  

FAQs - Comparing Two Columns In Excel

What is the best method to compare two columns in Excel?

The best method to compare two columns in Excel depends on your specific requirements and the nature of your data. Standard methods include using formulas like IF, VLOOKUP, or EXACT and conditional formatting and sorting/filtering techniques.

How can I highlight matching values between two columns?

You can use conditional formatting to highlight cells in one column that match those in another. Another option is to use the EXACT function to compare values and then apply conditional formatting based on the results.

What formula can I use to check if two cells have the same value?

You can use the EXACT function, which returns TRUE if two values are the same and FALSE otherwise. The formula would be: =EXACT(A1, B1), where A1 and B1 are the cells you want to compare.

Can we find differences between the two columns in Excel?

Yes, you can use conditional formatting to highlight cells in one column that differ from those in another. Additionally, you can use formulas like IF or VLOOKUP to identify and label differences.

How do I compare two columns to find duplicate values?

You can use conditional formatting to highlight duplicate values within each column separately. Alternatively, you can use the COUNTIF function to count occurrences of each value and identify duplicates.

What's the difference between comparing columns with conditional formatting and using formulas?

Conditional formatting is more visual and can quickly highlight matching or differing values. At the same time, formulas provide more detailed analysis and can be used to label, count, or extract specific data based on comparison results.

About the Author
author-image
Rashmi Karan
Manager - Content

Rashmi is a postgraduate in Biotechnology with a flair for research-oriented work and has an experience of over 13 years in content creation and social media handling. She has a diversified writing portfolio and aim... Read Full Bio