Compare Two Columns in Excel (Table of Contents)
Compare Two Columns in Excel
Comparing two columns in Excel is comparing the values in those columns. There are different ways to do this. In a first way, we can select the parallel cells of the columns which we want to compare by separating them with an equal sign (“=”). This will give us the output as TRUE and FALSE. If a cell of the columns is matched then we will get TRUE, else FALSE. In another way, we can use IF function to match the column cells the way we do by putting equal sign get the message we want when columns are matched.
How to Compare Two Column Data?
There are a lot of ways to do that. They are:
- Compare data in columns – Row-Wise
- Compare two columns Row-wise – Using Conditional Formatting
- Compare data Column wise – Highlight the matching data
Compare Two Column Data By Row-wise – Example #1
When we are looking for Exact match, use this technique. Let’s take the below example to understand this process.
We have given below dataset where we need to analyze the sold product of two stores month wise. Which means, Is the same product purchased by the customer in the same month or not?
If the same product is being sold month wise, the result should return as ‘TRUE’ otherwise ‘FALSE’.
For this, we will apply the below formula:
=B4=C4
Refer below screenshot:
The Result is shown below:
Drag & drop this formula for the rest values and the result is shown below:
4.9 (6,356 ratings)
View Course
Using Conditional Formatting – Example #2
By using conditional formatting, we can highlight the data in cells. If the same data point exists in both the column row wise, then we want to highlight those cells. Let’s take an example for this.
We have given year wise performance data where we want to analyze if we have achieved the same performance in the same year.
Follow below steps:
- Select the whole data set range. Here we have selected cell range B4: C18.
- Go to the HOME tab and Click on Conditional Formatting under the Styles section. Refer below screenshot.
- It will open a drop-down list of formatting options. Click on New Rule option here. Refer below screenshot.
- It will open a dialog box for New Formatting Rule as shown in below screenshot.
- Click on last option “Use a Formula to determine which cells to format” under Select a Rule Type section. After clicking on this option, it will display a Formula field as shown in below screenshot. Set a formula under Formula field. The formula we have used here as =$B4=$C4.Click on Format button and it will display Format Cells window.
- Click on Fill tab and choose the color from color palette. Click on OK. Refer below screenshot.
The Result is shown below:
Highlight the matching data – Example #3
Here we are comparing the data in whole list column-wise. Let’s take below example to understand this process.
- Select the entire dataset.
- Go to the HOME tab. Click on Conditional formatting under the Styles section. Click on Highlight Cells Rules and it will again open a list of options. Now click on Duplicate Values from the list. Refer below screenshot.
- It will open a dialog box for Duplicate Values. Click for a Duplicate option in the left side field and choose the color for highlighting the cells. Refer below screenshot. Click on OK.
- The result is shown below:
Things to Remember about Compare Two Columns in Excel
- We also can highlight the data for the unique values also.
- Through these techniques, we can easily compare the data in the dataset and highlight those cells.
Recommended Articles
This has been a guide to Compare Two Columns in Excel. Here we discuss Compare Two Columns in Excel and how to use the Compare Two Columns in Excel along with practical examples and downloadable excel template. You can also go through our other suggested articles –