Skip to content

How to find duplicates without highlighting in Excel

Flag duplicate values in a column with COUNTIF so you can filter, count and act on them, instead of only seeing them highlighted.

Conditional formatting can colour duplicate cells, which is useful for a quick look. It does not give you anything to filter on, count or hand to a formula. A formula that marks each row can do all three.

The core is COUNTIF, which counts how many times a value appears in a range. If the answer is greater than one, the value is a duplicate: =COUNTIF(A$2:A$11, A2)>1. The result is TRUE or FALSE, and you can filter on it with Data > Filter.

This marks every copy, including the first. Often you want to leave the first occurrence alone and flag only the repeats. Make the start of the range fixed and the end relative: =IF(COUNTIF(A$2:A2, A2)>1, "Repeat", ""). In row 2 the range is just A2, so a value cannot repeat. Further down, the range grows, so a value that appeared earlier is counted again and flagged.

That one dollar sign is the whole trick: A$2 stays anchored while A2 moves as you fill down. The Foundations track covers mixed references in detail.

If you do want colour, the ribbon way is Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. It marks all copies with no distinction, and does not leave a column you can sort.

Remember that COUNTIF ignores case and treats text and numbers as different. A code stored as text and the same code stored as a number will not match until you convert one of them.

3 ways to do it

1COUNTIF flag on every copy

=COUNTIF(A$2:A$11,A2)>1

  1. In B2 type =COUNTIF(A$2:A$11,A2)>1.
  2. Fill the formula down. TRUE marks any value that appears more than once.
  3. Turn on Data > Filter and filter column B to TRUE to see all duplicates together.

2Flag only the repeats (leave the first copy)

=IF(COUNTIF(A$2:A2,A2)>1,"Repeat","")

  1. In C2 type =IF(COUNTIF(A$2:A2,A2)>1,"Repeat",""). The range starts fixed at A$2 and ends at the current row.
  2. Fill down. The first copy of each value shows blank, and each later copy shows Repeat.

3Highlight with conditional formatting

  1. Select the column of values.
  2. Choose Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, then pick a colour and select OK.

Try it yourself

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, return TRUE if the invoice number in A2 appears more than once in A2:A11, otherwise FALSE. Fill down to B11.

Answer in B2, then it fills down to B11.

B2
A
B
C
D
1
Invoice no.
Duplicate?
Repeat?
2
INV-1001
3
INV-1002
4
INV-1003
5
INV-1002
6
INV-1004
7
INV-1005
8
INV-1003
9
INV-1006
10
INV-1002
11
INV-1007

Learn it properly, one graded sheet at a time.

Excel foundations covers this in lesson 15, IF: your first decision.