how to highlight duplicates in excel
|

How to Highlight Duplicates in Excel

Your list has repeats — a customer twice, an invoice number three times, or a name spelled two ways — and you need to see them before they cause trouble. I have cleaned lists like that many times, and the fastest way to start is to colour the repeats.

In this guide, I will show you how to highlight duplicates in excel with the built-in rule, formulas for the tricky cases, and a clean-up routine to keep your lists tidy.

To highlight duplicates in Excel, select your data, go to Home, then Conditional Formatting, then Highlight Cells Rules, and choose Duplicate Values. Excel colours every value that appears more than once. For whole rows, multi-column checks, or hiding the first copy, use a COUNTIF formula rule instead.

What Counts as a Duplicate in Excel

Before you colour anything, know the rule: a duplicate is a value that appears more than once in the range you select. Excel checks the whole value — “Sara” and “Sara Patel” are different, but “Sara” and “Sara” are the same.

Excel also ignores case in this check: “Apple”, “apple”, and “APPLE” count as the same value.

Spaces matter too: “Sara ” with a trailing space is not the same as “Sara”, and the number 100 is not the same as the text “100” — if your list looks the same but Excel disagrees, check these small differences first.

Duplicates vs. Unique Values

A unique value appears only once; a duplicate appears at least twice. I will show you how to highlight the duplicates first, then only the values that appear once — same method, different rule.

Highlight Duplicates With Conditional Formatting

Highlight Duplicates With Conditional Formatting

This is the fastest way to learn how to highlight duplicates in excel — try it first. It takes less than a minute, with no formula needed.

Follow These Steps

  1. Select the range with your data — for names in column A, select A2:A100, leaving the header row out.
  2. Go to the Home tab.
  3. Click Conditional Formatting.
  4. Point to Highlight Cells Rules.
  5. Click Duplicate Values.
  6. Choose a colour — the default light red fill is easy to see.
  7. Click OK.

Excel highlights every cell that appears more than once, and the rule stays live — a new name that already exists is highlighted at once.

To see the conditional formatting excel menu, use Home > Conditional Formatting > Highlight Cells Rules.

If you prefer keys to clicks, try excel keyboard shortcuts: press Alt, H, L, H, D. That opens the Duplicate Values box directly.

Tip: Apply the rule to the whole column, for example $A:$A, to cover new rows too. That is how to add multiple rows in excel without losing your highlight.

To change the colour, use Home > Conditional Formatting > Manage Rules. To remove it, choose Clear Rules > Clear Rules from Selected Cells.

Highlight Duplicates Except the First Occurrence

The basic rule highlights every copy, including the first one — many people only want the later copies highlighted, so the first entry stays clean.

You need a formula rule for this — just one small formula.

Follow These Steps

  1. Select your range, for example A2:A100.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Type this formula: =COUNTIF($A$2:A2,A2)>1
  5. Click Format, pick a fill colour, and click OK twice.

Here is how it works: $A$2:A2 is an expanding range that grows as Excel moves down the list — the first time a value appears, the count is 1; the second time it is 2, so Excel highlights it.

Make sure the first cell in your selection matches the formula — select A2:A100 and the formula must start at A2, or the highlight will land on the wrong rows.

Highlight Whole Duplicate Rows

Sometimes a single cell is not enough — highlight the whole row to check the name, the date, and the amount together.

Follow These Steps

  1. Select the full table, for example A2:D100, starting at the first data row, not the header.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Type this formula: =COUNTIF($A$2:$A$100,$A2)>1
  5. Click Format, pick a fill colour, and click OK twice.

The key is the mixed reference $A2: the column is locked but the row is free, so Excel checks column A for each row and highlights the row on a repeat.

For a name split across two columns, use a helper column: join the first name in column A and the last name in column B in column C with =A2&” “&B2. That is how to combine two cells in excel for a full-name check, and you can then run the duplicate rule on column C.

Highlight Duplicates Across Multiple Columns

Highlight Duplicates Across Multiple Columns

A value can be fine on its own but wrong in a pair: “Sara” may appear many times, but “Sara Patel” with the same email is the real duplicate — check two columns together.

Use COUNTIFS — it counts only when all the conditions match.

Follow These Steps

  1. Select the range you want to highlight, for example A2:B100.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Type this formula: =COUNTIFS($A$2:$A$100,$A2,$B$2:$B$100,$B2)>1
  5. Click Format, pick a fill colour, and click OK twice.

Excel now highlights a row only when the same name and email appear together — a shared first name alone will not trigger it.

Add a third column the same way — one more range-and-value pair in the COUNTIFS formula.

Count Duplicates With a COUNTIF Helper Column

Colour is useful, but a number is clearer: a helper column shows exactly how many times each value appears.

Follow These Steps

  1. Add a new header in the next empty column, for example Count in cell B1.
  2. In cell B2, type: =COUNTIF($A$2:$A$100,A2)
  3. Press Enter, then copy the formula down the column.
  4. Any value with a count of 2 or more is a duplicate; a count of 1 means it is unique.

The $ signs lock the full range, while the plain A2 changes as you copy down, so each row checks itself.

For the total, use a sum formula in excel at the bottom of the Count column: =SUM(B2:B100).

For the total of one value only, the Count column already shows it next to each name. And if you need to learn how to sum a column in excel, the same SUM formula works for any column of numbers: =SUM(B2:B100).

For a quick check against another list, use a lookup — in short, xlookup vs vlookup: use XLOOKUP to check if a value from your list exists in another list. It is the newer, simpler option.

Sort by the Count column, largest first.

Get a Clean List With the UNIQUE Function

For a new list with no repeats, use UNIQUE — it builds a clean list while your original stays the same.

Follow These Steps

  1. Click an empty cell where the clean list should start.
  2. Type: =UNIQUE(A2:A100)
  3. Press Enter.

Excel spills the result below, each value once, updating by itself if your source list changes.

For only the values that appear once, use: =UNIQUE(A2:A100,,TRUE). No UNIQUE setting returns only the repeats — use the COUNTIF helper column from section 6 and filter for counts above 1.

UNIQUE needs Microsoft 365, Excel 2024, Excel 2021, or Excel for the web; older versions should use Remove Duplicates instead (covered next).

Remove Duplicates Safely Without Losing Data

Highlighting shows you the problem; removing fixes it — but Remove Duplicates deletes data for good, so take care.

Copy the sheet first. Right-click the sheet tab, choose Move or Copy, tick Create a copy, and click OK.

Follow These Steps

  1. Click any cell inside your list.
  2. Go to the Data tab.
  3. Click Remove Duplicates.
  4. Tick the columns Excel should check. Untick any column you want to ignore.
  5. Click OK.

Excel reports how many duplicates it removed — check the result before you save.

Before you remove anything, tidy the list: first, learn how to remove blank rows in excel — select the range, press F5, click Special, choose Blanks, and delete those rows. Then run Remove Duplicates.

Filter by colour first to check the highlighted rows one by one, then review or delete only those rows.

For Microsoft’s full guide, read Microsoft’s own guide to finding and removing duplicates.

Stop Duplicates Before They Happen

The best fix is to stop duplicates at the door: Data Validation blocks a repeat as soon as it is typed.

Follow These Steps

  1. Select the range where entries go, for example A2:A100.
  2. Go to the Data tab and click Data Validation.
  3. Under Allow, choose Custom.
  4. Type this formula: =COUNTIF($A$2:$A$100,A2)=1
  5. Click the Error Alert tab and tick Show error alert after invalid data is entered.
  6. Type a short message, such as “This value already exists.”
  7. Click OK.

If someone types a value already in the list, Excel shows your warning and blocks the entry — useful for shared lists, order forms, and sign-up sheets.

One warning: Data Validation does not check pasted data, only typed entries — keep the Conditional Formatting rule as a safety net for pasted duplicates.

When the Highlight Does Not Work

If your rule finds nothing, do not assume your list is clean.

Trailing Spaces

A trailing space makes a value different — use =TRIM(A2) to remove extra spaces.

Numbers Stored as Text

The number 100 and the text “100” look the same but are treated as different — select the column and choose Convert to Number.

Case and Formatting

Excel ignores case, so “Apple” and “apple” will match. For a case-sensitive check, use EXACT, such as =SUMPRODUCT(–EXACT($A$2:$A$100,A2))>1.

Wrong Range

Check “Applies to” in Home > Conditional Formatting > Manage Rules — a rule that stops at row 50 will miss rows 51 to 100.

Mac, Windows, and Web Differences

These steps work on Windows, Mac, and the web. The UNIQUE function works on all three.

Sorting and Filtering by Colour

Once your duplicates are coloured, sort or filter by that colour: click the filter arrow, choose Filter by Color — or use Data > Sort and choose Cell Color.

FAQs

Why is Excel highlighting values that are not duplicates?

Excel highlights values that look the same to you but are not the same to Excel — usually a hidden difference like a trailing space or a number stored as text.

Check with =LEN(A2): different lengths mean a hidden space — clean with TRIM and reapply the rule.

How do I highlight duplicates in Excel without the first occurrence?

Use a formula rule with an expanding range: =COUNTIF($A$2:A2,A2)>1, applied through Home > Conditional Formatting > New Rule.

The first copy counts 1 and stays plain; later copies are highlighted.

Can I highlight duplicates in Google Sheets?

In Google Sheets, select the range, go to Format > Conditional formatting, choose Custom formula is, then type =COUNTIF($A$2:$A$100,A2)>1 and pick a colour.

For a count column, google sheets formulas work the same way: =COUNTIF($A$2:$A$100,A2) in a helper column. To group the flagged rows, use how to sort in google sheets: select the range, go to Data > Sort range, and sort by the helper column.

How do I highlight duplicate rows instead of single cells?

Select the whole table, then use a formula rule such as =COUNTIF($A$2:$A$100,$A2)>1, where the mixed reference $A2 checks the key column for each row.

Excel highlights the full row on a repeat — see section 4 for the two-column check.

Why does Conditional Formatting miss some duplicates?

Conditional Formatting misses duplicates when the values only look the same — trailing spaces, numbers stored as text, and different data types.

Clean with TRIM, convert text numbers, and check “Applies to” in Manage Rules.

How do I remove duplicates after highlighting them?

Filter by the highlight colour, review the rows, then use Data > Remove Duplicates. Always copy the sheet first.

Filtering by colour lets you check each duplicate first — Remove Duplicates cannot be undone after you save and close.

How do I highlight only the values that appear once?

Use a formula rule with =COUNTIF($A$2:$A$100,A2)=1, which highlights only values with a count of one.

Apply it via Home > Conditional Formatting > New Rule, choose “Use a formula”, and pick a colour.

Does highlighting duplicates work on Excel for Mac and the web?

The Duplicate Values rule works on Excel for Mac, Excel for the web, and Windows — the menus look slightly different, but the steps are the same.

On a Mac, it is on the Home tab.

My Go-To Routine for Clean Lists

Here is my routine for any new list: clean the data first — trim spaces and fix numbers stored as text. Next, apply the Duplicate Values rule so repeats jump out at once. Then add a COUNTIF helper column and sort by it to see how often each value appears. If the list is long, build a UNIQUE list for a clean copy. Finally, add Data Validation, so no one can type a repeat again.

That routine takes a few minutes and saves hours of fixing later. Start with the simple rule in section 2, add the helper column when you need numbers, and add validation when the list is shared — your lists will stay clean.

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *