Excel Compare Two Columns (Table of Contents)
- How to Compare Two Columns in Excel?
- Method #1 – Compare Using Simple Formulae
- Method #2 – Compare Using IF Formula
- Method #3 – Compare using EXACT Formula
- Method #4 – Using Conditional Formatting
How to Compare Two Columns in Excel?
How do you compare two columns in excel to find the deviation and differences in Excel? It is one of the most often used techniques in excel.
If you are drawing results it is very important to compare 2 columns in excel to see how these two columns differ from each other. It is almost an impossible task to scan through the entire data set and find the differences. Even if you rely on scanning through manually it won’t guarantee you 100% accuracy because of a human tendency to make mistakes.
Let us learn to Compare Two Columns in Excel with some examples.
Here we discuss the top 4 methods –
- Method #1 – Compare Using Simple Formulae
Method #2 – Compare Using IF Formula
Method #3 – Compare using EXACT Formula
Method #4 – Using Conditional Formatting
Method #1 – Compare Two Columns Data by Using Simple Formulae
We can compare 2 columns in excel by using one of the simple formulae. Assume you have two columns of data. The first column contains Log in Time and second column contains Log out Time.
From the above data, we need to compare who forgot to log out from their shift. If the Log in Time is equal to Log out Time then we can consider them as forgot to log out.
We can use a simple formula to do this task.
Step 1: Select the cell D2, then Open the equal sign and select the first cell as B2.
Step 2: Now again enter the equal sign after B2 and select the cell C2.
Step 3: Once you hit enter it will show either TRUE or FALSE. If the value in the cell B2 is equal to the value in the cell C2 it will show as TRUE or else it will show as FALSE.
Drag and drop the formula to remaining cells to get the results.
In the cells D5 and D9 we got the result as TRUE that means the value in the cell B5 is equal to C5.
Method #2 – Compare Two Columns Data in Excel by Using IF Formula and get the result as per our wish.
In the previous example, we got the results as TRUE or FALSE. But we need the results as Forgot to Punch out if the employee forgot to log out. We need the results as No Problem if the employee logs out.
We can get the result as per our wish by using IF function in excel.
Okay, now we got the results as we wanted. Let me break down the formula to understand it better.
=IF (B2=C2,”Forgot to Punch Out”, “No Problem”)
If condition tests whether the value in the cell B2 is equal to the value in the cell C2 if the result is TRUE it will return the result as “Forgot to Punch Out” and the result is FALSE it will return the result as “No Problem”.
Method #3 – Compare Two Columns in Excel with EXACT Formula
Take the same data for this example as well. I am going to apply an EXACT formula in excel to find the differences.
This formula also returns TRUE or FALSE as the result.
Note: The EXACT formula is case sensitive. Look at the below formula I have applied for text values.
In the cell C2, we got the result as FALSE even though the value in the cell A2 and B2 are same. Since there is upper case value in the cell B2 it will show the result as FALSE.
In the cell C3, we got the result as TRUE. Here the values in the cells A3 and B3 both are in the same case.
Method #4 – Compare Two Columns in Excel Using Conditional Formatting
In the previous examples, we have learned how to compare 2 columns in Excel and identify the same values.
In this example, I am going to explain to you how to highlight or compare 2 excel columns if there is duplicate data using Conditional Formatting
Take the same data from the above examples.
Step 1: Select the entire data and go to the Home tab > Conditional Formatting > New Rule.
Step 2: Once you click on New Rule it will open the below dialogue box. Select Use a formula to determine which cells to format.
Step 3: Apply the below formula is the formula section.
Step 4: Once the formula is applied click on Format > Go to Format. Select the color that you want to highlight and click on OK.
Step 5: It highlights the same matched values.
Okay, in this way we can compare 2 columns in excel and find the deviations.
Things to Remember
- There are several ways to compare 2 columns in excel. It depends on the data structure to apply which method is suitable.
- Try to identify the differences using IF condition. This would give the result as per our requirement.
- If you are using the EXACT formula you must keep in mind that it is a case-sensitive formula and highlight it as different if the data in the two cells are case sensitive.
- Method 1 is the easiest way to compare 2 column values in excel.
This has been a guide to compare Two Columns in Excel. Here we discuss top 4 methods to compare two columns in excel 1) Using Simple Formula, 2) IF formula, 3) Exact function and 4) Conditional Formatting along with practical examples and downloadable excel template. You may learn more about excel from the following articles –
- Excel Highlight Duplicates
- Freeze Columns Excel
- Group Columns Excel
- Examples of Pivot Table Sort
- Benefits of using the Drawing Tools in Excel
- Conditional Format in the Pivot Table
- Rows to Columns in Excel
- Conditional Formatting Based on another Cell Value
- Removing Duplicates in Excel
- Count Only Unique Values in Excel
- Split Panes in Excel
- Using Advanced Excel Filter