Highlight Duplicates using Conditional Formatting
You can use conditional formatting to highlight duplicate values in your data. This can help you visually inspect your data and decide whether to keep or delete the duplicates. To use conditional formatting, follow these steps:
- Select the range of cells that you want to check for duplicates.
- Click on the
Home
tab and click onConditional Formatting
in theStyles
group. - Click on
Highlight Cells Rules
- Click on
Duplicate Values
in the submenu. - In the
Duplicate Values
dialog box, choose a format to apply to the duplicate cells. You can also change the values option toUnique
if you want to highlight only the unique values instead of the duplicates. - Click
OK
and Excel will apply the formatting to your data.
For older versions (97-2003)
- Select
Format » Conditional Formatting
. - The Conditional Formatting dialog box appears.
- Select
Formula Is
from the top-left pop-up menu. - In the field to its right, enter the following code for a table of data with a range of
A1:C5
:=COUNTIF($A$1:$C$5,A1)>1
- Click the
Format
tab followed by thePatterns
tab - Select a color you want applied to visually identify duplicate data.
- Click
OK
to return to the Conditional Formatting dialog box - Click
OK
again to apply the formatting.
Using the Remove Duplicates
feature in the Data
tab
The Remove Duplicates
command essentially looks for distinct values in each column you selected and then removes all records necessary to end up with a unique list of values in each column.
- Select the range of cells that you want to check for duplicates.
- Click on the
Data
tab. - Click on
Remove Duplicates
in theData Tools
group. - In the
Remove Duplicates
dialog box, uncheck the columns that you don’t want to use as criteria for finding duplicates. - Click
OK
and Excel will delete any duplicate rows.
Excel will delete any duplicate entries and display a message telling you how many values were removed and how many values remain as shown in the following figure:
Note: The Remove Duplicate feature will not delete duplicate entries between the columns.