Intermediate

How to highlight duplicates in Excel: Duplicate Values and COUNTIF rules

Find duplicates by color in Excel: the Duplicate Values rule, highlighting whole rows, flagging only repeat occurrences, and the long-number and trailing-space traps.

A cashier is checking the payment log: if a receipt was entered twice, the customer was charged twice or the report overstates revenue. In a 500-row log you can’t spot that by eye.

Before you delete duplicates, you need to see them: which ones are real mistakes and which are legitimate repeats (two purchases by the same customer, for instance). Excel’s conditional formatting does exactly that — it colors repeated values and leaves the data untouched.

Книга1 - Excel
—☐✕
fx
ABCD
1Receipt #CustomerAmount
2A-1021Aziz Karimov450 000
3A-1022Dilnoza Rakhimova1 200 000
4A-1023Javokhir Turaev320 000
5A-1022Dilnoza Rakhimova1 200 000
6A-1024Malika Yusupova780 000
7A-1025Sardor Aliev150 000
8A-1021Aziz Karimov450 000
9
Готово
Receipts A-1021 and A-1022 were entered twice — Duplicate Values turns them red immediately

Method 1: Duplicate Values — two clicks

1

Select the column to check (A2:A8). Главная → Условное форматирование → Highlight Cells Rules.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить
Буфер обмена
Calibri ▾11 ▾
Шрифт
Выравнивание
Общий ▾
Число
Условное форматированиеФорматировать как таблицуСтили ячеек
Стили
ВставитьУдалитьФормат
Ячейки
АвтосуммаСортировка и фильтрНайти и выделить
Редактирование
A2fxA-1021
ABCD
1Receipt #Customer
2A-1021Aziz Karimov
3A-1022Dilnoza Rakhimova
4A-1023Javokhir Turaev
5A-1022Dilnoza Rakhimova
6
ГотовоКоличество: 4

2

In the submenu choose the last item, Duplicate Values...

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить
Буфер обмена
Calibri ▾11 ▾
Шрифт
Выравнивание
Общий ▾
Число
Условное форматированиеФорматировать как таблицуСтили ячеек
Стили
ВставитьУдалитьФормат
Ячейки
АвтосуммаСортировка и фильтрНайти и выделить
Редактирование
A2fxA-1021
ABCD
1Receipt #Customer
2A-1021Aziz Karimov
3A-1022Dilnoza Rakhimova
4A-1023Javokhir Turaev
5A-1022Dilnoza Rakhimova
6
ГотовоКоличество: 4

3

The dialog shows Duplicate on the left and a color on the right (default Light Red Fill with Dark Red Text). Click OK — repeated receipts turn red.

Книга1 - Excel
—☐✕
A2fxA-1021
ABCD
1Receipt #Customer
2A-1021Aziz Karimov
3A-1022Dilnoza Rakhimova
4A-1023Javokhir Turaev
5A-1022Dilnoza Rakhimova
6
ГотовоКоличество: 4

4

To see only the repeats: turn on the filter (Ctrl + Shift + L) → column A → Filter by Color → red.

Method 2: a formula rule — whole row, repeats only

1

Duplicate Values colors the first copy too. Often you want to keep the original and see only the extra copies. Select the whole table (A2:C8) → Условное форматирование → New Rule... → Use a formula to determine which cells to format.

2

Enter =СЧЁТЕСЛИ($A$2:$A2;$A2)>1. Meaning: “from the top of the table down to this row, has this receipt appeared more than once?” The first occurrence is 1 (not colored), the second is 2 (colored).

Книга1 - Excel
—☐✕
A2fxA-1021
ABCD
1Receipt #CustomerAmount
2A-1021Aziz Karimov450 000
3A-1022Dilnoza Rakhimova1 200 000
4A-1023Javokhir Turaev320 000
5
ГотовоСреднее: 656666,6667Количество: 9Сумма: 1970000

3

The $ in $A2 locks the column: cells in B and C are also checked against column A, so the whole row gets colored. The result: only rows 5 and 8.

Книга1 - Excel
—☐✕
fx
ABCD
1Receipt #CustomerAmount
2A-1021Aziz Karimov450 000
3A-1022Dilnoza Rakhimova1 200 000
4A-1023Javokhir Turaev320 000
5A-1022Dilnoza Rakhimova1 200 000
6A-1024Malika Yusupova780 000
7A-1025Sardor Aliev150 000
8A-1021Aziz Karimov450 000
9
Готово
Originals stay white, extra copies are red. Now it’s safe to delete exactly those

Method 3: a helper column — count and filter

1

If you need a flag for printing or for further formulas, type =СЧЁТЕСЛИ($A$2:$A$8;A2) in D2 (how many times in total) and =ЕСЛИ(СЧЁТЕСЛИ($A$2:A2;A2)>1;"Repeat";"") in E2 (which occurrence), then fill down.

Книга1 - Excel
—☐✕
E5fx=ЕСЛИ(СЧЁТЕСЛИ($A$2:A5;A5)>1;"Repeat";"")
ABCDEF
1Receipt #CustomerAmountTotalFlag
2A-1021Aziz Karimov450 0002
3A-1022Dilnoza Rakhimova1 200 0002
4A-1023Javokhir Turaev320 0001
5A-1022Dilnoza Rakhimova1 200 0002Repeat
6A-1024Malika Yusupova780 0001
7A-1025Sardor Aliev150 0001
8A-1021Aziz Karimov450 0002Repeat
9
Готово

2

Filter column E for “Repeat” — only the extra rows remain. Select and delete them, then clear the filter.

Pro level: duplicates across several columns and managing rules

  • Two columns repeating together: the same customer paid the same amount twice — =СЧЁТЕСЛИМН($B$2:$B$8;$B2;$C$2:$C$8;$C2)>1. A repeat in one column can be normal; in both at once it is suspicious.
  • The reverse — find unique values: in the Duplicate Values dialog choose Unique instead of Duplicate — only values that occur once are colored.
  • Rule range: if new rows aren’t covered, open Условное форматирование → Manage Rules... and extend the range in Applies to. Better still, turn the range into a table (Ctrl + T) first — the rule then extends to new rows automatically.
  • Common values of two lists: select both ranges with Ctrl and apply Duplicate Values — what appears in both gets colored.

Try it in the simulator

The simulator has no conditional formatting, so flag repeats with formulas: type =СЧЁТЕСЛИ($A$2:$A$8;A2) in D2 and fill down to D8. Then type =ЕСЛИ(СЧЁТЕСЛИ($A$2:A2;A2)>1;"Repeat";"") in E2 to find only the extra copies.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1Receipt #CustomerAmountTotalFlag
2A-1021Aziz Karimov450000
3A-1022Dilnoza Rakhimova1200000
4A-1023Javokhir Turaev320000
5A-1022Dilnoza Rakhimova1200000
6A-1024Malika Yusupova780000
7A-1025Sardor Aliev150000
8A-1021Aziz Karimov450000
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

145 / 154