How to Highlight Duplicates but Keep One in Excel (4 Methods)

We have a large Excel worksheet that contains information about several sales representatives of the Armani Group. The name of the Product and the Product ID are given in Columns D and C.

how to highlight duplicates in excel but keep one


Method 1 – Use the Conditional Formatting Command 

Steps:

  • Select cells that we want to highlight duplicates but keep one. We selected cells from B5 to B16.
  • From your Home tab, go to:

Home → Styles → Conditional Formatting → Highlight Cells Rules → Duplicate Values

Use the Conditional Formatting Command to Highlight Duplicates but Keep One in Excel

  • A dialog box named Duplicate Values pops up.
  • From the Duplicate Values dialog box, select the Duplicate values with Light Red Fill with Dark Red Text option from the Format cells that contain.
  •  Press OK.

  • After pressing OK, you will be able to highlight the duplicate value that has been given in the below screenshot.

Use the Conditional Formatting Command to Highlight Duplicates but Keep One in Excel

  • We will keep one duplicate.
  • To do that, from your Data tab, go to:

Data → Data Tools →  Remove Duplicates

  • A warning dialog box named Remove Duplicates Warning will appear.
  • From that warning box, select Continue with the current selection.
  • Press Remove Duplicates.

Use the Conditional Formatting Command to Highlight Duplicates but Keep One in Excel

  • A Remove Duplicates window pops up.
  • From that window, press OK.

Use the Conditional Formatting Command to Highlight Duplicates but Keep One in Excel

  • After completing the above process, you will be able to highlight duplicates but keep one that has been given in the screenshot below.

Read More: How to Highlight Duplicates in Two Columns Using Excel Formula


Method 2 – Highlight Duplicates or Unique Values Using Conditional Formatting

Steps:

  • Select cells from B5 to B16.
  • From your Home tab, go to:

Home → Styles → Conditional Formatting → Highlight Cells Rules → Duplicate Values

Apply the Conditional Formatting Command to Highlight Duplicates or Unique Values in Excel

  • A dialog box named Duplicate Values will appear.
  • From the Duplicate Values dialog box, select the Unique values with Green Fill with Dark Green Text from the drop-down box.
  • Press OK.

  • While pressing OK, you will be able to highlight the unique values that have been given in the below screenshot.

Apply the Conditional Formatting Command to Highlight Duplicates or Unique Values in Excel


Method 3 – Using a New Rule of Conditional Formatting

3.1 Duplicates without First Occurrence

Steps:

  • Select cells from B5 to B16.
  • From your Home tab, go to:

Home → Styles → Conditional Formatting → New Rule

Duplicates without First Occurrence

  • A dialog box named New Formatting Rule will appear.
  • Follow the steps for the New Formatting Rule dialog box.
  • Select Use a formula to determine which cells to format from the Select a Rule Type:
  • Enter the below formula in the Format values where this formula is true:. The COUNTIF function is:
=COUNTIF($B$5:$B5,$B5)>1
  • Press the Format option.

  • After clicking on the Format option, a Format Cells dialog box pops up.
  • From that dialog box, select the Fill.
  • Select any color from the Background Color menu. We have chosen a light golden color.
  • Click OK.

Duplicates without First Occurrence

  • You will go back to the New Formatting Rule dialog box.
  • Click OK.

  • While completing the above process, you will be able to highlight duplicates without the first occurrence given in the screenshot below.

Duplicates without First Occurrence


3.2 Second Occurrence of Duplicates Only

Steps:

  • Select cells D5 to D16.

Second Occurrence of Duplicates Only

  • Enter the below formula in the box:
=COUNTIF($B$5:$B5,$B5)=2

  • After repeating the sub-method, you will get your desired output, which has been given in the screenshot below.

Second Occurrence of Duplicates Only


3.3 Values Occurring Third Time

Steps:

  • Select cells from B5 to B16.
  • From your Home tab, go to:

Home → Styles → Conditional Formatting → New Rule

highlight duplicates in excel but keep one

  • A dialog box named New Formatting Rule will appear.
  • Follow the steps for the New Formatting Rule dialog box.
  • Select Use a formula to determine which cells to format from the Select a Rule Type:
  • Enter the below formula in the Format values where this formula is true:
=COUNTIF($B$5:$B5,$B5)=3
  • Press the Format option.

  • After clicking on the Format option, a Format Cells dialog box pops up.
  • From that dialog box, select the Fill.
  • Select any color from the Background Color menu. We have chosen a light golden color.
  • Click OK.

highlight duplicates in excel but keep one

  • You will go back to the New Formatting Rule dialog box.
  • Click OK.

  • After completing the above process, you will be able to highlight duplicates without the third occurrence that has been given in the below screenshot.

highlight duplicates in excel but keep one


Method 4 – Using Multiple Columns to Highlight Duplicates but Keep One

Steps:

  • Select cells B5 to D16.

Multiple Columns to Highlight Duplicates in Excel

  • Perform similarly according to sub-method 3.1 except the formula applied in the Format values where this formula is true: Enter the below formula in that type box:
=COUNTIF(B$5:$B$14,B5)+COUNTIF(C$5:C5,C5)>1

  • After repeating the sub-method, you will get your desired output, which has been given in the screenshot below.

Multiple Columns to Highlight Duplicates in Excel

Read More: How to Highlight Duplicates in Multiple Columns in Excel


Things to Remember

To acquire the desired outcome, you must carefully follow all of the procedures and make any required adjustments to the cell references.


Download the Practice Workbook

Download this workbook practice.


Related Articles


<< Go Back to Duplicates in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdur Rahim Rasel
Md. Abdur Rahim Rasel

MD. ABDUR RAHIM is a marine engineer proficient in Excel and passionate about programming with VBA. He views programming as an efficient means to save time while managing data, handling files, and engaging with the internet. His interests extend to Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning, reflecting his versatile skill set. He earned a B.Sc in Naval Architecture & Marine Engineering from BUET, and now he has become a content developer, creating technical content... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo