This tutorial shows you how to automatically highlight duplicate entries in Excel. We'll cover shading duplicate cells, entire rows, or consecutive duplicates using conditional formatting and a powerful add-in.
Last week, we looked at using formulas to find duplicates. Highlighting them visually, however, makes analysis significantly easier. Conditional formatting is the quickest method, automatically flagging new duplicates as you type.
These methods work across all Excel versions (365, 2021, 2019, 2016, 2013, 2010, and earlier).
- Highlight Duplicates (Except First Instance)
- Highlight Duplicates Across Multiple Columns
- Highlight Nth and Subsequent Duplicates
- Shade Entire Rows Based on Duplicate Column Values
- Highlight Duplicate Rows
- Find Consecutive Duplicates
- Duplicate Remover Add-in (Fastest Method)
Highlighting Duplicates in Excel
Excel has a built-in rule for this. Follow these steps:
- Select the data range (column, row, or range).
- Go to the Home tab, click Conditional Formatting > Highlight Cells Rules > Duplicate Values…
- The Duplicate Values dialog appears. Click OK to use the default red highlighting, or Custom Format… to choose your own colors.
Tip: Select "Unique" to highlight unique values instead.
This highlights duplicates across multiple columns (though it doesn't compare between columns – it simply flags all duplicates within the selected range).
Important Notes:
- This rule works on individual cells, not entire rows. For row-level highlighting, you'll need custom rules.
- It highlights all duplicates, including the first instance.
Highlighting Duplicates (Except First Instance)
To highlight only the second and subsequent occurrences:
- Select the cells.
- Go to Home > Conditional Formatting > New Rule > Use a formula…
- Enter this formula:
=COUNTIF($A$2:$A2,$A2)>1
(replaceA2
with the topmost cell of your range). - Click Format…, choose your color, and click OK.
This highlights duplicates after the first instance.
Highlighting Nth and Subsequent Duplicates
Modify the formula above to highlight from the Nth occurrence:
- 3rd and subsequent:
=COUNTIF($A$2:$A2,$A2)>=3
- 4th and subsequent:
=COUNTIF($A$2:$A2,$A2)>=4
- Only the 2nd instance:
=COUNTIF($A$2:$A2,$A2)=2
Highlighting Duplicates Across Multiple Columns
To highlight duplicates across multiple columns (without comparing between columns):
-
Including First Occurrences: Use Excel's built-in duplicate rule or this formula:
=COUNTIF($A$2:$C$8, A2)>1
(adjust range as needed). -
Excluding First Occurrences: This requires two rules: one for the first column (same as the "except first instance" rule above), and another for subsequent columns using a more complex formula (see original article for details). A single, more complex formula is also provided in the original article.
Highlighting Entire Rows Based on Duplicate Column Values
Select entire rows, then use these formulas:
-
Excluding First Instance:
=COUNTIF($A$2:$A2, $A2)>1
-
Including First Instance:
=COUNTIF($A$2:$A$15, $A2)>1
(adjust range as needed).
Highlighting Duplicate Rows (Across Multiple Columns)
Use COUNTIFS
to compare across multiple columns:
-
Excluding First Instance:
=COUNTIFS($A$2:$A2, $A2, $B$2:$B2, $B2)>1
-
Including First Instance:
=COUNTIFS($A$2:$A$15, $A2, $B$2:$B$15, $B2)>1
(adjust range as needed).
Highlighting Consecutive Duplicates
Select cells, then use these formulas:
-
Excluding First Instance:
=$A1=$A2
-
Including First Instance:
=OR($A1=$A2, $A2=$A3)
Formulas to ignore blank cells are also provided in the original article.
Highlighting Duplicates with the Duplicate Remover Add-in
The Duplicate Remover add-in offers a much faster way. It can highlight duplicates with various options (including color choices) in just a few clicks (see original article for screenshots and detailed instructions). The add-in provides both a quick "Dedupe Table" option and a more advanced step-by-step wizard.
The above is the detailed content of How to find and highlight duplicates in Excel. For more information, please follow other related articles on the PHP Chinese website!

This tutorial shows you how to automatically highlight duplicate entries in Excel. We'll cover shading duplicate cells, entire rows, or consecutive duplicates using conditional formatting and a powerful add-in. Last week, we looked at using formulas

The tutorial explains how to search for duplicates in Excel. You will learn a few formulas to identify duplicate values or find duplicate rows with or without first occurrences. You will also learn how to count instances of each duplicate

This tutorial explains how to safeguard specific Excel cells from accidental modification or unauthorized editing. It covers locking individual cells, unlocking cells on a protected sheet (with or without a password), and identifying locked/unlocked

This tutorial demonstrates how to safeguard Excel spreadsheets with or without passwords, and how to recover access if a password is forgotten. Protecting your worksheets, especially when sharing them externally, is crucial to prevent unauthorized mo

A must-have for Excel experts: the wonderful use of the F4 key, a secret weapon to improve efficiency! This article will reveal the powerful functions of the F4 key in Microsoft Excel under Windows system, helping you quickly master this shortcut key to improve productivity. 1. Switching formula reference type Reference types in Excel include relative references, absolute references, and mixed references. The F4 keys can be conveniently switched between these types, especially when creating formulas. Suppose you need to calculate the price of seven products and add a 20% tax. In cell E2, you may enter the following formula: =SUM(D2 (D2*A2)) After pressing Enter, the price containing 20% tax can be calculated. But,

This tutorial shows you how to count unique and distinct values in Excel using formulas and PivotTables. We'll cover counting unique names, text, numbers, and case-sensitive values, as well as handling blank cells. The key difference between "u

This tutorial provides a concise overview of Excel's COUNT and COUNTA functions, illustrating their use with practical examples. You'll also learn how to leverage COUNTIF and COUNTIFS for counting cells based on specific criteria. Excel excels at nu

Excel's PIVOTBY Function vs. PivotTables: A Detailed Comparison Excel offers two powerful tools for data summarization and reorganization: the PIVOTBY function and PivotTables. Both group and aggregate data for detailed analysis, but their usage dif


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version
God-level code editing software (SublimeText3)
