Compare Two Columns in Excel (Table of Contents)
Compare Two Columns in Excel
Excel has a lot of in-built features and techniques through which we can do the calculation and analyze the data. But whatever excel does, it is applicable only in one column. Which means whenever in excel we want to compare and match the data, most of the time it focuses only on one column. In this article, we will learn the easy ways to compare the data in two columns.
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:
Refer below screenshot:
The Result is shown below:
Drag & drop this formula for the rest values and the result is shown below:
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.
You can download this Compare Two Columns Excel Template here –Compare Two Columns Excel Template
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 –