Compare two Columns in Excel
Two columns in excel are compared when their entries are studied for similarities and differences. The similarities are the data values that exist in the same row of both the compared columns. In contrast, the differences are those values that exist in only one of these columns.
For example, for a specific month, a table displays the following information:
Key Takeaways
- Column A lists the names of the employees who took three consecutive leaves.
- Column B lists the names of the employees who took two consecutive leaves.
Since the data pertains to the same organization, there can be a similarity or a difference within the given set of values. The same is explained as follows:
- A similarity or a match (column A is equal to column B) implies employees who took both three and two continuous leaves.
- A difference (column A is not equal to column B) implies employees who took either three or two continuous leaves.
It is difficult to scan through the data to track the matches and the differences manually. Hence, there are techniques which can be followed to compare 2 columns of an excel worksheet.
How to Compare two Columns in Excel? (Top 4 Methods)
The top four methods to compare 2 columns are listed as follows:
- Method #1โCompare using simple formulae
- Method #2โCompare using the IF formula
- Method #3โCompare using the EXACT formula
- Method #4โCompare using conditional formatting
Letย usย understandย theseย methods with the help of examples.
#1 – Compare Using Simple Formulae
The following table shows the names of the employees of an organization in column A. Columns B and C display their log-in and the log-out times respectively.
We want to compare two excel columns B and C to find out the employees who forgot to logout from the office. The official timings are 10:30 a.m.-7:30 p.m. Use the formula method for comparison.

For the given data, if the log-in time is equal to the log-out time, we assume that the employee has forgotten to logout.
The steps to compare two columns in excel with the help of the comparison operator โequal toโ (=) are listed as follows:
- In cell D2, enter the symbol โ=โ followed by selecting the cell B2.

- Enter the symbol โ=โ again, followed by selecting the cell C2.

- Press the โEnterโ key. It returns โfalse.โ This implies that the value in cell B2 is not equal to that of cell C2.

- Drag or copy-paste the formula to the remaining cells. The output is either โtrueโ or โfalse,โ as shown in the following image.If the value in column B is equal to that of column C, the result is โtrue,โ else โfalse.โ The cells D5 and D9 show the output โtrue.โHence, Roshan and Uday forgot to logout from the office.

#2 – Compare 2 Columns Using the IF Formula
Working on the data of example #1, we want the following results:
- โForgot to punch out,โ if the employee forgets to logout
- โNo problem,โ if the employee logs out
Use the IF function to compare the columns B and C.
We apply the following formula.
โ=IF(B2=C2,โForgot to Punch Outโ,โNo Problemโ)โ
If the value in column B is equal to that of column C, the result is โtrue,โ otherwise โfalse.โ For every โtrueโ value, the formula returns โforgot to punch out.โ Likewise, it returns โno problemโ for every โfalseโ value.
The output is shown in column E of the following image.
Hence, Roshan and Uday are the only two employees who have forgotten to logout from the office.

#3 – Compare Using the EXACT Formula
Working on the data of example #1, we want to compare the two excel columns B and C with the help of the EXACT function.
We apply the following formula.
โ=EXACT(B2,C2)โ
If the value in column B is equal to that of column C, the formula returns โtrue,โ otherwise โfalse.โ The output is shown in column F of the following image.
Hence, the entries of columns B and C are identical for Roshan and Uday.
Note: The EXACT function is case-sensitive.

We have written the name โRamanโ in columns A and B with different casing. We apply the following formula.
โ=EXACT(A2,B2)โ
The formula returns โfalseโ when the casing of cell A2 is different from that of cell B2. Likewise, it returns โtrueโ if the casing in columns A and B is the same.
The output is shown in column C of the following image.

#4 – Compare 2 Excel Columns Using Conditional Formatting
Working on the data of example #1, we want to highlight those entries that are identical in columns B and C. Use the conditional formatting feature.

Step 1: Select the entire data. In the Home tab, click the โconditional formattingโ drop-down under the โstylesโ section. Select โnew rule.โ

Step 2: The โnew formatting ruleโ window appears. Under โselect a rule type,โ choose the option โuse a formula to determine which cells to format.โ

Step 3: Enter the formula โ$B2=$C2โ under โedit the rule description.โ

Step 4: Click โformat.โ In the โformat cellsโ window, select the color to highlight the identical entries. Click โOk.โ Click โOkโ again in the โnew formatting ruleโ window.

Step 5: The matches of columns B and C are highlighted, as shown in the following image.
Hence, the entries of columns B and C are identical for Roshan and Uday.

The Properties of the Comparison Methods
The features of the comparison methods discussed are listed as follows:
- The outcomes of the IF function can be modified according to the requirement of the user.
- The EXACT function returns โfalseโ for two same values having different casing.
- The simplest technique to compare two excel columns is by using the comparison operator โequal toโ (method #1).
Note: The comparison method to be used depends on the data structure and the kind of output required.
Frequently Asked Questions (FAQs)
What does it mean to compare two columns and how is it done in Excel?
The comparison of two data columns helps find the similarities and the differences. In case of similarity, a value exists in the same row of both the columns. In contrast, a difference is a deviation of one value from the other.
To compare two excel columns, the easiest approach is listed as follows:
a. Enter the following formula.
โ=cell1=cell2โ
The โcell1โ is a cell containing a data value in the first column. The โcell2โ is a cell containing a data value in the second column. Both โcell1โ and โcell2โ are in the same row.
b. Press the โEnterโ key.
The formula returns โtrueโ or โfalseโ depending on whether the value exists in both the compared columns or not.
How to highlight the different values of two columns without using the formula in Excel?
Let us compare the following 2 columns consisting of names in the mentioned sequence:
โข Column A contains Jack, Adam, Elizabeth, Betty, and Veronica.
โข Column B contains Robert, Peter, Elizabeth, Henry, and Veronica.
The steps to highlight the different values without using the formula are listed as follows:
a. Select columns A and B.
b. In the Home tab, click โfind and selectโ drop-down under the โeditingโ group. Choose โgo to special.โ
c. In the โgo to specialโ window, select โrow differences.โ Click โOk.โ
The names Robert, Peter, and Henry of column B are highlighted. These cells can be colored using the โfill colorโ property of Excel.
How to compare multiple columns in Excel?
Let us compare the following columns consisting of numbers in the mentioned sequence:
โข Column A contains 3, 49, 20, 22, and 86 in the range A1:A5.
โข Column B contains 29, 49, 38, 21, and 86 in the range B1:B5.
โข Column C contains 12, 49, 56, 24, and 86 in the range C1:C5.
The steps to compare columns A, B, and C are stated as follows:
a. Enter the following formula in cell D1. โIF(COUNTIF($A1:$C5,$A1)=3,โfull matchโ,โโ)โ
b. Press the โEnterโ key.
c. Drag or copy-paste the formula to the remaining cells.
Since we are comparing three excel columns, we enter the number 3 in the formula. The formula returns โfull matchโ in cells D2 and D5. It returns an empty string in the cells D1, D3, and D4.
Hence, the numbers 49 and 86 appear in the respective rows 2 and 5 of all the three columns.
Recommended Articles
This has been a guide to compare two columns in Excel. Here we discussed the top 4 methods to compare 2 columns in Excel, 1) the operator โequal toโ, 2) IF function, 3) EXACT formula, and 4) conditional formatting. We also went through some practical examples. You can download the Excel template from the website. For more on Excel, take a look at the following articles-



