In this guide
Appearance
Appearance
By Scot, 10+ years in IT support and helpdesk ·How these guides are checked
Select the range, then click Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, pick a fill color, and click OK. Every repeated value changes color.
Checked against Microsoft 365 Roadmap, Office release notes - Current Channel and between 5 Aug 2026 and 12 Sep 2026. Nothing published in that period has been linked to this guide.
This article shows you how to find duplicate values in a spreadsheet and mark them so you can decide what to do next — which is a different job from deleting them. You will highlight repeats in one column or across several, count them, mark only the second and later copies, compare two sheets, filter down to the marked rows, and clear the formatting afterwards. If you already know the duplicates have to go, How to Remove Duplicate Rows in Excel covers the deletion side.
In this guide
This is the two-click answer, and it covers most situations — a list of email addresses, invoice numbers, or staff IDs where any repeat is a problem.
Every repeated value in the selection now carries the fill you chose. The first occurrence is colored too — the rule marks all copies, including the original.
Note: The rule compares values cell by cell within the range you selected. Selecting two columns at once treats them as one long list, so a value in column A matching a value in column D counts as a duplicate. Select one column at a time unless that is what you want.
Verification: Type an existing value into the first empty cell below the data. It changes color as soon as you press Enter, and the value it matches changes with it. Press Ctrl + Z to undo the test entry.
A colored cell tells you which value repeats. A colored row tells you which record to look at. This needs a formula rule.
A2:F500, for example. Do not include the header row.A to whichever column decides whether a row is a duplicate:=COUNTIF($A:$A,$A2)>1Every row whose column A value appears more than once is now filled edge to edge.
The dollar signs are doing the work here. $A locks the column so every cell in the row looks at column A, while the row number 2 stays relative so it moves down the range. Change either one and the rule shades the wrong things — Understanding Absolute and Relative Cell References in Excel explains why.
To treat a row as a duplicate only when two or more columns match — first name and last name, or customer and order date — use COUNTIFS instead:
=COUNTIFS($A:$A,$A2,$B:$B,$B2)>1Tip: Start the formula at the same row your selected range starts at. If you selected
A2:F500, the formula refers to row 2. Selecting from row 5 and writing a formula that refers to row 2 shifts the whole rule three rows out of step.
The built-in rule marks every copy, which is unhelpful when you are deciding what to delete — you want to see the extras, not the originals.
=COUNTIF($A$1:$A1,$A1)>1The first appearance of each value stays plain and every later copy is colored. The trick is the expanding range: $A$1:$A1 is anchored at the top but grows as the rule moves down the column, so each cell counts only the occurrences above it plus itself.
Note: Adjust the row numbers to match where your data starts. With a header row and data beginning in row 2, select from row 2 and use
=COUNTIF($A$2:$A2,$A2)>1.
Tip: Sort the column before you apply this rule and the marked cells group together, which makes reviewing them far quicker. How to Sort and Filter Data in Excel covers sorting without scrambling the rest of the row.
Before you spend an afternoon on this, find out how big the problem actually is. Put these formulas in empty cells to the side of your data.
How many times each value appears — put this in a helper column beside the data and fill it down:
=COUNTIF($A:$A,$A2)How many cells are part of a duplicate group:
=SUMPRODUCT(--(COUNTIF(A2:A500,A2:A500)>1))How many rows you would lose if you removed the duplicates — the count of extra copies, in Microsoft 365 and Excel 2021:
=COUNTA(A2:A500)-COUNTA(UNIQUE(A2:A500))On Excel 2019, which has no UNIQUE function, use this instead:
=COUNTA(A2:A500)-SUMPRODUCT(1/COUNTIF(A2:A500,A2:A500))Note: The last formula returns
#DIV/0!when the range contains blank cells. Shrink the range to the rows that actually hold data, or use the helper column approach and count the entries greater than 1.
COUNTIF is doing the heavy lifting in all of these — see How to Use SUMIF and COUNTIF in Excel for what else it handles.
Tip: Select the helper column and read the bottom-right status bar. Excel shows Count, Average, and Sum for the selection without you writing anything at all.
This is the "did we already invoice them last month" check. It highlights values on one sheet that also exist on another.
LastMonth with that sheet's tab name exactly as it appears at the bottom of the window:=COUNTIF(LastMonth!$A:$A,$A2)>0Values that exist on both sheets are now colored. To see the opposite — entries that are new this month — change >0 to =0.
Note: A tab name containing a space needs single quotation marks around it, like
='Last Month'!$A:$A. Excel adds them for you if you click the other sheet's tab while building the formula, but typing the reference by hand does not.
Tip: In Excel 2007, cross-sheet references inside conditional formatting rules are blocked. Select the range on the other sheet, type a name such as
LastMonthIDsinto the Name Box to the left of the formula bar, press Enter, and use=COUNTIF(LastMonthIDs,$A2)>0instead.
Highlighting shows you the problem. Filtering gets everything else out of the way.
If Filter by Color is greyed out, the highlighting came from a formula rule that Excel cannot resolve to a single fill. Use the helper column from Step 4 instead: click its filter arrow, choose Number Filters > Greater Than, enter 1, and click OK.
Verification: The row numbers down the left edge turn blue and skip — 4, 11, 12, 27. That is Excel telling you rows are hidden by a filter rather than deleted.
Note: Filtered rows are hidden, not removed. Click the filter arrow and choose Clear Filter From to bring everything back, or press Ctrl + Shift + L twice to turn filtering off and on again.
Conditional formatting rules travel with the file. Clear them before you send the workbook on, or the next person spends ten minutes wondering what the red means.
To remove one rule and keep the others:
Note: Clear Rules removes conditional formatting only. Fills you applied by hand with the Fill Color button stay put — remove those with Home > Clear > Clear Formats, which also strips fonts and number formats from the selection.
TIP
Duplicate hunting goes faster when the data is clean first. Run the column through =TRIM(A2) to strip leading and trailing spaces, paste the result back as values, and re-run the rule. Stray spaces are the single most common reason two identical-looking entries fail to match.
| Symptom / Error | Potential Cause | Solution |
|---|---|---|
| Identical-looking values are not highlighted | Trailing spaces or mixed data types | Clean the column with TRIM, and check whether some entries are numbers stored as text — see How to Fix Numbers Stored as Text in Excel. |
| ACME and acme are treated as the same value | The built-in rule ignores case | Use a formula rule with =SUMPRODUCT(--EXACT($A$2:$A$500,$A2))>1 for a case-sensitive comparison. |
| The formula rule colors the wrong rows | Range and formula start on different rows | The formula must refer to the first row of the range you selected. Reselect from the first data row and re-enter the rule. |
| Everything in the range turns one color | Row reference locked with a dollar sign | Check the formula reads $A2, not $A$2. The row number stays relative so the rule moves down the range. |
| Filter by Color is greyed out | Formula-based rule, or filtering is off | Turn filtering on with Ctrl + Shift + L, then filter the helper column from Step 4 for values greater than 1. |
| New Rule has no formula option | Older Excel for the web build | Click Editing > Open in Desktop App at the top right, apply the rule there, and save. The formatting is preserved when the file reopens in the browser. |
IT Tip Tuesday
Get a short, actionable IT tip in your inbox every week.
Nothing loads from beehiiv until you click. Once it does, the form sets beehiiv's own cookies and loads beehiiv's own analytics.