Finding duplicate values in Excel columns is, on closer inspection, not such a simple task. It usually comes up when you can’t just remove duplicate cells, because first you need to decide which of the repeated values to delete.
Test how repeated values should be treated before deleting anything: include the first occurrence or mark only later matches.
Finding duplicates can mean very different things, and depending on the input, it’s done differently. To pick the right method, first answer a few questions.
This is one example. See the full article for Excel 2013 and newer alternatives: Unique values and duplicate counts in older and newer Excel versions.
Key questions to ask when finding duplicates
- What exactly repeats: words inside cells, entire cells or entire rows?
- If cells, which ones count as duplicates: all except the first occurrence, or including it?
- Are “Apple” and “Apple ” (with an extra space) duplicates? What about “apple” and “APPLE”?
- Where do we look: in one column, between two columns or across several?
- How do we want to see them: highlighted with color, marked with TRUE/FALSE, or with the number of repetitions next to each value?
Let’s start with simple examples.
Using Conditional Formatting to highlight duplicates
Conditional Formatting is the built-in tool for highlighting duplicate cells. It has a number of ready-made rules, including one for duplicate values. You’ll find it on the Home tab.
How to use it
- Select the range where you want to find duplicates.
- Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
- Choose the formatting for the matching cells: a preset one or your own.
The caveat
It’s important to understand that the rule finds duplicates within the entire selected range, so it may not work for comparing two columns. A duplicate inside one column is enough, and the rule highlights it, even though the second column has no such value:
This behavior is not obvious and is often forgotten. If you then plan to delete the repeats, you may lose both copies from the same column.
How to avoid it if you need duplicates between columns? The simplest way is to remove duplicates inside each column first. But there are other solutions, read on.
Using formulas for greater control
Your own formula for checking duplicates has several advantages. The only difficulty is building it, and I’ve done that for you :)
Finding duplicates within a single range
To check whether a range contains any repeated values at all, use this array formula based on the COUNTIF and SUMPRODUCT functions:
=SUMPRODUCT(COUNTIF(A1:A100,A1:A100)-1)>0
COUNTIF counts how many times each value occurs in the range, and the formula returns TRUE if at least one of them occurs more than once.
To mark each cell instead of the whole range, put this formula next to the first cell and fill it down. It returns TRUE for every value that occurs more than once:
=COUNTIF($A$1:$A$100,A1)>1
And this one marks only the second and following occurrences, leaving the first one unmarked. That’s exactly what you need before deleting:
=COUNTIF($A$1:A1,A1)>1
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Value | Repeats (all) | 2nd+ occurrence | Any repeats in range? | |
| 2 | apple | TRUE=COUNTIF($A$2:$A$7,A2)>1 | FALSE=COUNTIF($A$2:A2,A2)>1 | TRUE=SUMPRODUCT(COUNTIF(A2:A7,A2:A7)-1)>0 | |
| 3 | pear | TRUE=COUNTIF($A$2:$A$7,A3)>1 | FALSE=COUNTIF($A$2:A3,A3)>1 | ||
| 4 | apple | TRUE=COUNTIF($A$2:$A$7,A4)>1 | TRUE=COUNTIF($A$2:A4,A4)>1 | ||
| 5 | plum | FALSE=COUNTIF($A$2:$A$7,A5)>1 | FALSE=COUNTIF($A$2:A5,A5)>1 | ||
| 6 | pear | TRUE=COUNTIF($A$2:$A$7,A6)>1 | TRUE=COUNTIF($A$2:A6,A6)>1 | ||
| 7 | apple | TRUE=COUNTIF($A$2:$A$7,A7)>1 | TRUE=COUNTIF($A$2:A7,A7)>1 |
Column B marks every value that occurs more than once. Column C counts from the top down to the current row, so the first “apple” stays FALSE — filter by TRUE and delete safely. E2 answers whether the range has any duplicates at all.
Why bother with formulas if Conditional Formatting does the same? Because a formula is easy to modify and improve.
For example, you can add the TRIM function to it. Then it also finds duplicates that differ only in invisible extra spaces:
=SUMPRODUCT(--(TRIM(A1)=TRIM($A$1:$B$4)))>1
| A | B | C | |
|---|---|---|---|
| 1 | Column A | Column B | Duplicate ignoring spaces? |
| 2 | apple | pear | TRUE=SUMPRODUCT(--(TRIM(A2)=TRIM($A$2:$B$5)))>1 |
| 3 | pear· | apple·· | TRUE=SUMPRODUCT(--(TRIM(A3)=TRIM($A$2:$B$5)))>1 |
| 4 | plum | kiwi | FALSE=SUMPRODUCT(--(TRIM(A4)=TRIM($A$2:$B$5)))>1 |
| 5 | kiwi | fig | TRUE=SUMPRODUCT(--(TRIM(A5)=TRIM($A$2:$B$5)))>1 |
· shows a space. “pear·” and “pear” are the same after TRIM. The check runs over both columns A:B; as a Conditional Formatting rule it highlights every such cell.
This formula is slightly different: it checks how many times the value of one cell occurs in the range. If you add it as a Conditional Formatting rule (Home → Conditional Formatting → New Rule → Use a formula), it detects these implicit duplicates:
Note one detail: the range is fixed with dollar signs ($A$1:$B$4), and the checked cell (A1) is not. That’s what lets the rule check each cell against the whole range. Here is the result: the cells are highlighted even though they differ in the number of spaces.
Finding duplicates between two columns
To find the values of column A that also occur in column B, regardless of their position, count them in the other column:
=COUNTIF($B$1:$B$100,A1)>0
| A | B | C | |
|---|---|---|---|
| 1 | List A | List B | In B? |
| 2 | apple | kiwi | TRUE=COUNTIF($B$2:$B$5,A2)>0 |
| 3 | pear | apple | FALSE=COUNTIF($B$2:$B$5,A3)>0 |
| 4 | plum | fig | FALSE=COUNTIF($B$2:$B$5,A4)>0 |
| 5 | kiwi | TRUE=COUNTIF($B$2:$B$5,A5)>0 |
The position doesn’t matter: “apple” is in B3, “kiwi” in B2.
TRUE means the value from A1 is somewhere in column B. This is how you compare two lists without the caveat of Conditional Formatting described above.
Case-sensitive duplicates
COUNTIF ignores case: for it, “apple” and “APPLE” are the same. If case matters, use the EXACT function:
=SUMPRODUCT(--EXACT(A1,$A$1:$A$100))>1
| A | B | C | |
|---|---|---|---|
| 1 | Value | COUNTIF (ignores case) | EXACT (case-sensitive) |
| 2 | Apple | TRUE=COUNTIF($A$2:$A$6,A2)>1 | TRUE=SUMPRODUCT(--EXACT(A2,$A$2:$A$6))>1 |
| 3 | apple | TRUE=COUNTIF($A$2:$A$6,A3)>1 | FALSE=SUMPRODUCT(--EXACT(A3,$A$2:$A$6))>1 |
| 4 | APPLE | TRUE=COUNTIF($A$2:$A$6,A4)>1 | FALSE=SUMPRODUCT(--EXACT(A4,$A$2:$A$6))>1 |
| 5 | Apple | TRUE=COUNTIF($A$2:$A$6,A5)>1 | TRUE=SUMPRODUCT(--EXACT(A5,$A$2:$A$6))>1 |
| 6 | pear | FALSE=COUNTIF($A$2:$A$6,A6)>1 | FALSE=SUMPRODUCT(--EXACT(A6,$A$2:$A$6))>1 |
COUNTIF treats “Apple”, “apple” and “APPLE” as the same value. EXACT compares letter case, so only the two “Apple” cells are duplicates.
List of duplicates in Excel 365
In Excel 365, you can get a separate list of the values that repeat, each of them once:
=UNIQUE(FILTER(A1:A100,COUNTIF(A1:A100,A1:A100)>1))
| A | B | C | |
|---|---|---|---|
| 1 | Value | Duplicates (once) | |
| 2 | apple | apple=UNIQUE(FILTER(A2:A7,COUNTIF(A2:A7,A2:A7)>1)) | |
| 3 | pear | pear | |
| 4 | apple | ||
| 5 | plum | ||
| 6 | pear | ||
| 7 | kiwi |
FILTER keeps the values that occur more than once, and UNIQUE leaves one copy of each. The list spills down and updates when the data changes.
All these formulas work, but each of them has to be typed, the references fixed with dollar signs where needed, filled down, and then the helper column removed.
A faster solution: the !SEMTools add-in
When I combine overlapping order exports, the same order ID can appear twice. I select a copy of the ID column on the !SEMTools tab, run the duplicate check, then filter the TRUE/FALSE column beside the original records. Choose the check according to which rows you want to review.
Find duplicate cells in a column, except the first
Choose FIND → Duplicates → Within list → All except first. The comparison ignores case.
ORD-86140 occurs twice in this export. Its first row gets FALSE and the later copy gets TRUE. If one export contains newer records, sort the whole table so the row you mean to keep comes first.
Find all duplicate cells in a column, including the first
Path: FIND → Duplicates → Within list → All including first.
To review both rows for ORD-86140, use this mode. It marks both copies TRUE so you can compare the original records side by side. ORD-86144 appears once and stays FALSE.
For a customer-order export, see how to mark one-time and repeat customers or find their first and last orders.
Find duplicates with words in a different order
Choose FIND → Duplicates → Within list → Including other word order when grouping a keyword list. The first “running shoes men” stays FALSE. “shoes running men” and “men running shoes” get TRUE because they contain the same words. “trail running shoes” starts a separate group.
Find duplicates in a column ignoring extra spaces
If phrases that differ only in the number of spaces between or after words count as duplicates, first get rid of the extra spaces, and then run the same search. For the first step, !SEMTools has a separate tool to remove extra spaces:
When word forms differ as well, see how to normalize phrases before removing implicit duplicates.
To compare two columns, use FIND → Duplicates → Compare with another list and choose a full match or any word order.
Why duplicates aren’t found: common mistakes
- Obvious duplicates are not found. The values differ in spaces, invisible characters or case. Remove extra spaces first or use the TRIM version of the formula.
- Numbers and the same numbers stored as text. For Excel, 1024 and “1024” are different values. Convert the column to one type before searching.
- Both copies were deleted. Conditional Formatting highlights all occurrences, including the first one. Mark only the second and following occurrences before deleting.
Find duplicates in a column except or including the first occurrence, right in place, without COUNTIF formulas or helper columns.
!SEMTools solves this and hundreds of other tasks in a couple of clicks!
Summary: which way to find duplicates
I hope you found what you were looking for on this page and were able to find the duplicates in your data. Conditional Formatting is fine for a quick look at one column, formulas give control over spaces, case and comparing columns, but each of them takes time to build and fill down. For regular work with lists, the !SEMTools procedures mark duplicates in a couple of clicks right in place.
You may also be interested in related operations:


