Are you working with Excel and struggling to identify and highlight duplicate values across two columns? You're not alone. Duplicates can cause inconsistencies and errors in your data, making it crucial to identify and remove them. In this guide, we'll walk you through a simple yet powerful method to highlight duplicates in two columns using Excel's Conditional Formatting feature.
Understanding Conditional Formatting
Conditional Formatting is a feature in Excel that allows you to apply formatting to cells based on their values. It's an incredibly useful tool for data analysis and visualization. In our case, we'll use it to highlight cells that contain duplicate values in two columns.
Preparing Your Data
Before we start, ensure your data is structured correctly. For this method, you need two columns of data side by side. Let's say your data looks like this:

| Column A | Column B |
|---|---|
| Apple | Red |
| Banana | Yellow |
| Apple | Green |
| Cherry | Red |
In this example, "Apple" and "Red" are duplicates that we want to highlight.
Highlighting Duplicates in Two Columns
Now, let's use Conditional Formatting to highlight these duplicates:
- Select the range of cells you want to check for duplicates. In our case, this is A1:B5.
- Click on the "Home" tab in the Excel ribbon, then click on "Conditional Formatting" in the "Styles" group.
- From the dropdown menu, select "New Rule..."
- In the "New Formatting Rule" dialog box, select "Use a formula to determine which cells to format".
- In the "Format values where this formula is true:" box, enter the following formula:
=COUNTIF($A$1:$A1, $A1) * COUNTIF($B$1:$B1, $B1) > 1 - Choose the formatting you want to apply (like filling the cells with a color).
- Click "OK" to close the dialog boxes.
The formula we used works by counting the number of times the value in the current cell appears in both columns. If this count is greater than 1, the cell is formatted (highlighted).

Adjusting the Formula for Larger Data Sets
If you're working with a larger data set, you'll need to adjust the formula to reference the entire range of cells. For example, if your data is in A1:B1000, the formula would be: =COUNTIF($A$1:$A1000, $A1) * COUNTIF($B$1:$B1000, $B1) > 1
Removing Duplicates
Once you've highlighted the duplicates, you can choose to remove them. Select the range of cells, click on the "Home" tab, then "Remove Duplicates" in the "Editing" group. Excel will remove the duplicates, leaving only the first occurrence of each pair.
And that's it! You've now learned how to highlight and remove duplicates in two columns using Excel's Conditional Formatting feature. This method is powerful, flexible, and easy to use, making it a valuable tool in your data analysis toolkit.





![How to Highlight a Column in Excel? [Window 10 & 11 Guide] - MiniTool Partition Wizard](https://i.pinimg.com/originals/62/21/fe/6221fe089a3e2712132f93dfd57453bb.png)
















