Find, Highlight, and Remove Duplicates in Excel [Step-by-Step]

Finding, Highlighting, and Removing duplicates are an integral part of data cleansing in Excel. With that being said this tutorial with guide you to find, highlight & remove duplicates in Excel.

Find Duplicates in Excel Using IF & COUNTIF with Customized Message

In the column, Ice Cream Flavors, I’ve got a list of different ice cream flavor names. I’ve created a blank column named “Duplicate” to identify the ice cream flavor names as “Duplicate” and “Unique”. To do all of these, I’ll be using a formula consisting of the IF and COUNTIF functions.

Syntax

IF(COUNTIF(range, criteria),value_if_true,value_if_false)

Formula

=IF(COUNTIF($B$2:$B2,B2)>1,"Duplicate","Unique")

Formula Explanation

The COUNTIF function compares the content of cell B2 with that of the range $B$2:$B2. The function counts the occurrences of the value in this expanding range, and the IF statement evaluates whether the count is greater than 1. If the count is greater than 1, it indicates that the value appears more than once in the range, and the formula returns “Duplicate”. Conversely, if the count is 1 or less, signifying that the value is unique within the range, the formula returns “Unique”. This formula is designed to dynamically identify duplicate values as it is copied down to different rows in column B.

To find duplicates with IF and COUNTIF functions, follow these steps below:

  1. Select a blank cell
  2. Type this formula: =IF(COUNTIF($B$2:$B2,B2)>1,”Duplicate”,”Unique”)
    Using IF and COUNTIF function to Find Duplicates in Excel
  3. Press ENTER to insert the formula into cell C2.
    Formula result : Find Duplicates in Excel
  4. Now, select the entire column from cell C2 to cell C10.
  5. Then, press CTRL + D.
    This will instantly copy down the formula applied in cell C2 with changing cell references.

As the formula is applied to the entire cell, all the ice cream flavor names in column B will be marked either as “Duplicate” or “Unique” in column C.

Find Duplicates in Excel: Final Result



Find Duplicates in Excel with Conditional Formatting Highlighting Cells

Highlighting duplicate values is very easy in Excel. You can use Conditional Formatting to easily do that. Now, let me show you the whole process in detail. So, go through these steps below to highlight cells containing duplicates:

  1. Select the range of data to highlight.
    Selecting cells to Highlight Duplicates in Excel
  2. Click on the Home tab.
  3. Now, select the Styles group.
  4. Click on the Conditional Formatting drop-down.
  5. Navigate Highlight Cells Rules ⋙ Duplicate Values.
  6. Select a formatting color combination from the Duplicate Values dialog box.
    Using Conditional Formatting to Highlight Duplicates in Excel
  7. Then, click OK.

Duplicate values dialog box to highlight cells with duplicate in Excel

All the duplicate values in the selected range will be highlighted with the chosen color combination.

Highlight Duplicates in Excel: Final Result



Remove Duplicates in Excel Using Conditional Formatting

Excel offers several methods to remove duplicate values from your spreadsheet. Here, I’m going to show you remove duplicates using the Conditional Formatting feature in Excel.

Formula

=IF(COUNTIF($B$2:$B2,B2)>1,"Duplicate","Unique")

To remove duplicates in Excel using the Conditional Formatting, go through these steps below:

  1. Create a blank column first.
  2. Type the formula in cell C2: =IF(COUNTIF($B$2:$B2,B2)>1,”Duplicate”,”Unique”)
    Read an explanation of how this formula works from_here.
    Using IF and COUNTIF Function to find duplicates in Excel
  3. Press ENTER to insert the above formula in cell C2.
    Applied formula with IF and COUNTIF function to find duplicates in Excel
  4. Double-click on the cell C2 to auto-fill the formula and select the range.
    Duplicate values and identified in Excel using a formula
  5. Go to Home menu > Styles group > Conditional Formatting drop-down > Highlight Cells Rules > Text that Contains command.
    Using conditional formatting to highlight duplicates in Excel
  6. Insert the text “Duplicate” and select your preferable cell color in the “Text that Contains” dialog box.
    Selection of Fill Color to highlight the duplicate text in Excel
    All the cells having the text “Duplicate” will be highlighted in the column, “Duplicate”.
  7. Select the entire Duplicate column with the column header too.
    Selecting highlighted duplicates to remove duplicates in Excel using conditional formatting
  8. Navigate the Data menu > Sort & Filter group > Filter command.
    Using Filter command to filter out the duplicates in Excel
  9. Click on the drop-down of the column, Duplicate.
  10. Select “Duplicate” only from the context menu and hit OK.
    Filtering out the duplicates in Excel
    Only the duplicate items will be filtered out with all of them selected.
    Filtered duplicates in Excel
  11. Now, press CTRL + – from your keyboard.
    Or, right-click to choose
    Delete from the context menu.
  12. Then, just hit OK.

Remove Duplicates in Excel Using Conditional Formatting

All the duplicate items will be deleted straightway leaving the unique rows left behind.

Output: Remove Duplicates in Excel Using Conditional Formatting



Conclusion

I’ve discussed some effective techniques to find, highlight, and delete duplicates in Excel. I expect you’ve found this article useful. You can read more articles relating to Excel from the Blog page of our website. Have a fantastic workday!

Frequently Asked Questions

Is there a quick way to highlight in Excel?

To quickly highlight cells in Excel:

  1. Select the range of cells you want to highlight.
  2. Use the keyboard shortcut:
    For Windows, press ALT + H + H to open the Home tab, then press H for the Fill menu, and finally press H for the Highlight Cells option.
    For Mac, press Command + Option + H to open the Home tab, then press H for the Fill menu, and finally press H for the Highlight Cells option.

This shortcut allows you to highlight cells without using the mouse. Adjust the keys based on your operating system. This quick method streamlines the highlighting process, making it efficient and convenient.

How do I show only duplicates in Excel?

To show only duplicates in Excel:

  1. Select the column or range where you want to identify duplicates.
  2. Go to the Home tab on the ribbon.
  3. Click on Conditional Formatting in the Styles group.
  4. Choose Highlight Cells Rules from the drop-down menu.
  5. Select Duplicate Values from the sub-menu.
  6. In the dialog box, choose a formatting style for the duplicates and click OK.

This will highlight or format cells with duplicate values, making them easily visible. Adjust the range and formatting options as needed.

How do I auto highlight in Excel?

To automatically highlight specific values in Excel:

  1. Select the range of cells where you want the highlighting to occur.
  2. Go to the Home tab on the ribbon.
  3. Click on Conditional Formatting in the Styles group.
  4. Choose New Rule from the drop-down menu.
  5. In the “New Formatting Rule” dialog box, select “Format cells that contain“.
  6. Choose the condition (e.g., “Cell Value,” “Specific Text,” etc.) and set the criteria.
  7. Click on the Format button to choose the formatting style for the highlighted cells.
  8. Click OK to apply the formatting.

The specified cells will now be automatically highlighted based on the defined rule. Adjust the range and formatting options according to your requirements.

How do I remove highlighted cells in Excel?

To remove highlighted cells in Excel:

  1. Select the range of cells from which you want to remove the highlighting.
  2. Go to the Home tab on the ribbon.
  3. Click on Conditional Formatting in the Styles group.
  4. Choose Clear Rules from the drop-down menu.
  5. Select “Clear Rules from Selected Cells” to remove highlighting only from the current selection.

This will remove any conditional formatting or highlighting applied to the selected cells, leaving them in their default appearance. Adjust the range and options as needed.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *