How to Mark Duplicates in Excel: Complete Guide to Highlighting, Counting, and Managing Duplicate Values
Learn how to mark duplicates in Excel using conditional formatting, COUNTIF formulas, and Power Query. Highlight, count, and manage duplicates fast.

Learning how to mark duplicates in Excel is one of the most practical data-cleaning skills you can build, and it pays off every single time you open a spreadsheet that someone else touched.
Whether you are reconciling a customer list, auditing inventory SKUs, comparing two columns of email addresses, or preparing a CSV for import into a CRM, the ability to instantly highlight repeat values transforms a tedious manual review into a five-second task. Excel offers several methods, and choosing the right one depends on your dataset size, your version of Excel, and whether you want to keep, count, or delete the repeats.
The most common method, conditional formatting, lets you color-code duplicates automatically the moment you click a single menu option, making it the go-to choice for analysts who need a fast visual scan. But that is only the beginning. With COUNTIF, you can flag duplicates with a TRUE/FALSE column. With Power Query, you can isolate duplicates into a dedicated table. With pivot tables, you can summarize how often each value repeats. Each method serves a different downstream purpose, and mastering all four will make you noticeably faster at every data task.
This guide walks through every reliable approach, from beginner-friendly clicks to advanced formulas, with screenshots of menu paths described in plain text so you can follow along in Excel for Microsoft 365, Excel 2021, Excel 2019, and Excel for the web. We will also cover how to mark duplicates across multiple columns, how to spot case-sensitive duplicates that the built-in tools miss, and how to combine highlighting with filtering so you can act on the flagged rows immediately rather than just looking at them.
Before we dive in, it helps to define what Excel considers a duplicate. By default, Excel treats two cells as duplicates when their visible text matches, ignoring formatting differences and treating uppercase and lowercase letters as the same. So "Apple" and "apple" are duplicates to Excel, but "Apple " with a trailing space is not. This distinction matters when you are cleaning real-world data scraped from forms or pulled from legacy systems, because invisible characters can hide true duplicates that look identical to a human eye.
If you have ever used vlookup excel functions to pull matching records from one sheet to another, you already understand how Excel compares values internally. The same matching logic powers conditional formatting for duplicates, COUNTIF, and the Remove Duplicates feature. Once you grasp how Excel decides what "equal" means, every method in this guide becomes intuitive rather than mysterious, and you will start spotting opportunities to apply these techniques across reports you maintain weekly.
One quick note before we start: marking duplicates and removing them are two very different actions. Marking is reversible and non-destructive, meaning you can review what Excel found before deciding what to do. Removing is permanent unless you immediately press Ctrl+Z. Throughout this guide we lean heavily on marking first, because no analyst has ever regretted being too cautious with a client dataset, while plenty have regretted hitting Remove Duplicates on a column they did not fully understand.
By the end of this article you will be able to confidently highlight duplicates in any version of Excel, choose between visual flagging and formula-based flagging, handle multi-column duplicates, count how many times each value repeats, and decide when to clean versus when to preserve the original data. Let us begin with the fastest method available to every Excel user on the planet: conditional formatting.
Duplicate Detection in Excel by the Numbers

Five Steps to Mark Duplicates Fast
Select Your Range
Open Conditional Formatting
Choose Duplicate Values
Pick a Color
Review and Act
Conditional formatting is the most powerful tool Excel offers for marking duplicates because it is dynamic, visual, and completely non-destructive. Once you apply the rule, Excel continuously evaluates your data and updates the highlighting whenever you add, edit, or delete a value. This means you can paste new records into your sheet and watch fresh duplicates light up automatically without re-running any commands. It is the foundation of every clean-data workflow used by financial analysts, marketers, and operations teams who work with refreshable reports.
To apply the basic duplicate highlight, select your range, then navigate to Home, Conditional Formatting, Highlight Cells Rules, and Duplicate Values. The dialog box that appears includes two crucial dropdowns. The first lets you toggle between Duplicate and Unique. Choosing Unique flips the logic to highlight only the values that appear exactly once, which is incredibly useful when you are trying to spot outliers in an otherwise repetitive list, such as a single typo in a long column of department names.
The second dropdown contains color presets. The default Light Red Fill with Dark Red Text is fine for quick scans, but click Custom Format to access full control over font, border, and fill. Many analysts use yellow for soft warnings and red for hard duplicates that must be deleted. Picking distinct colors becomes essential when you stack multiple rules on the same range, for instance flagging duplicates in one color and blank cells in another so you can address both issues in a single pass.
For more advanced scenarios, skip the preset menu and go directly to Conditional Formatting, New Rule, Use a Formula to Determine Which Cells to Format. Here you can write a COUNTIF expression like =COUNTIF($A$2:$A$1000,A2)>1 that gives you complete control over the comparison logic. This formula-based rule is what you need when the default Duplicate Values option does not quite fit, such as when you want to ignore the first occurrence and only highlight the second, third, and later instances of each value.
To highlight only the repeats while leaving the first occurrence unmarked, use the formula =COUNTIF($A$2:A2,A2)>1 with mixed references. The locked top anchor combined with the unlocked bottom row means each cell only counts values above it, so the first appearance returns 1 and stays unhighlighted while every subsequent appearance returns 2 or more and lights up. This trick is invaluable when you want to preserve original records and visually mark only the surplus copies for deletion review.
You can also stack rules to highlight duplicates with different urgency levels. For example, apply one rule that marks any duplicate in yellow, then add a second rule that marks values appearing three or more times in red. Use the formula =COUNTIF($A$2:$A$1000,A2)>=3 for the red rule and place it above the yellow rule in the Manage Rules dialog so it takes precedence. This layered approach helps you triage cleanup work, tackling the most repeated values first.
If you regularly add a filter in Excel to your data, you will be happy to know conditional formatting plays nicely with filters. Once duplicates are highlighted, click the filter arrow on the column header, choose Filter by Color, and pick the duplicate color. Excel collapses the view to show only the flagged rows, letting you copy them to another sheet, edit them in bulk, or delete them after a quick visual confirmation that no critical records are caught in the net.
Methods to Remove Duplicates Excel Users Should Know
The COUNTIF function is your best friend for marking duplicates with a TRUE/FALSE flag column. In an empty column next to your data, enter =COUNTIF(A:A,A2)>1 and copy it down. Every row containing a duplicate returns TRUE while unique values return FALSE. You can then filter or sort by the flag column to group duplicates together for review or deletion.
To rank occurrences, use =COUNTIF($A$2:A2,A2) instead. This returns 1 for the first instance, 2 for the second, and so on, giving you a numeric breakdown of how each value accumulates through the list. Combine it with a helper column that shows the total count using =COUNTIF(A:A,A2) and you have a complete duplicate audit in two simple formulas.

Conditional Formatting vs Remove Duplicates: Which Should You Use?
- +Conditional formatting is fully reversible and never changes your underlying data
- +Highlights update automatically when you add or edit cells
- +You can stack multiple color rules for different duplicate severities
- +Works seamlessly with filter by color for fast triage
- +Handles unlimited columns with custom formula rules
- +Available in every Excel version since 2007
- +Lets you review duplicates before deciding which to keep
- −Conditional formatting can slow large files with many rules applied
- −Default rule is case-insensitive and ignores leading or trailing spaces
- −Remove Duplicates is permanent and cannot be undone after save
- −Remove Duplicates always keeps the first occurrence, never letting you choose
- −Highlighting alone does not actually clean the data
- −Formula-based methods require basic syntax knowledge
- −Color filters do not work in older Excel versions before 2010
Checklist to Mark Duplicates in Excel Correctly
- ✓Always work on a copy of your file before applying destructive operations
- ✓Select the full range including every relevant column before opening Conditional Formatting
- ✓Use Custom Format to pick high-contrast colors that print clearly in black and white
- ✓Trim leading and trailing spaces with the TRIM function before flagging duplicates
- ✓Convert text to consistent case with UPPER or LOWER for accurate matching
- ✓Use COUNTIF with an absolute range reference when adding a flag column
- ✓Apply Filter by Color to isolate flagged rows for bulk review or deletion
- ✓Stack multiple rules to differentiate two-time repeats from frequent duplicates
- ✓Document your conditional formatting rules in a hidden notes sheet for future reference
- ✓Re-run Remove Duplicates only after visually confirming the highlight matches expectations
Always mark before you remove
Conditional formatting is reversible, but Remove Duplicates is permanent the moment you save and close the file. Always highlight duplicates first, scroll through the results, and confirm Excel flagged what you expected before running any deletion. This two-step workflow has saved countless analysts from losing legitimate records that happened to share a value in one column.
Marking duplicates across multiple columns introduces a new layer of complexity because Excel needs to evaluate combinations of values rather than single-cell matches. Imagine a customer list with first name, last name, and email columns. Two people might share the first name John and the last name Smith without being duplicates if their email addresses differ. To handle this correctly, you need a concatenation strategy that joins the columns into a single comparable string, then flags rows where that combined string repeats.
The easiest approach is to add a helper column with a formula like =A2&"|"&B2&"|"&C2 that joins the values from columns A, B, and C with a pipe separator. The pipe character prevents false matches that could occur if two different combinations produced the same concatenated string, like "Ann" plus "Marie" versus "Annma" plus "rie". Once the helper column exists, apply your standard COUNTIF or conditional formatting rule against it, and Excel will mark only true multi-column duplicates.
For dynamic spillover behavior in Microsoft 365, you can use TEXTJOIN with an array reference. The formula =TEXTJOIN("|",TRUE,A2:C2) accomplishes the same goal more elegantly and adapts if you insert or delete columns. Pair this with a COUNTIF that references the entire helper column, and you have a multi-column duplicate detector that scales to dozens of columns without rewriting the formula every time your dataset structure changes during the analysis process.
An alternative approach is to use the COUNTIFS function directly, skipping the helper column entirely. The formula =COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,C2)>1 evaluates whether each row has the same combination of column A, B, and C values as any other row. This keeps your sheet clean of helper columns but can be slower on very large datasets because COUNTIFS evaluates multiple criteria simultaneously for every cell in the formula column.
The Remove Duplicates tool also handles multiple columns natively. When you click the button on the Data tab, Excel shows a dialog listing every column in your range with a checkbox next to each. Check only the columns that should participate in the duplicate match. If you want to consider only first name and last name as the match criteria but keep the email column intact, check just the first two boxes. Excel will collapse rows that share both names while preserving the email of whichever row appears first in the data.
Case sensitivity is the gotcha that catches many analysts. Excel's built-in duplicate detection treats "john@example.com" and "JOHN@example.com" as identical, which is usually what you want for email addresses. But if you are working with case-sensitive identifiers like API keys, passwords, or codes where casing matters, you need the EXACT function. Use =SUMPRODUCT(--EXACT($A$2:$A$1000,A2))>1 as your conditional formatting rule to catch only true case-matching duplicates while letting different-case variants pass through unmarked.
Finally, when you count unique values in Excel as part of a duplicate audit, the COUNTA function alone is not enough because it counts every non-blank cell including the duplicates. Instead use =SUMPRODUCT(1/COUNTIF(A2:A1000,A2:A1000)) for older versions or the modern =COUNTA(UNIQUE(A2:A1000)) in Microsoft 365. Comparing the unique count to the total row count gives you the exact number of duplicate entries hiding in your data before you decide whether to highlight, isolate, or remove them.

Excel treats "Apple" and "Apple " with a trailing space as different values, so true duplicates often hide behind invisible whitespace from copy-paste or CSV imports. Always wrap your duplicate check with TRIM, for example =COUNTIF(A:A,TRIM(A2))>1, or run a global Find and Replace on space characters before flagging. Skipping this step is the most common reason analysts miss obvious repeats.
Beyond the core methods, several pro-level techniques will turn you into the duplicate-detection expert on your team. The first is using pivot tables to summarize duplicate counts without modifying the source data. Insert a pivot table from your range, drag the column you want to audit into both the Rows area and the Values area, and Excel will display each unique value alongside the number of times it appears. Sort by count descending to immediately see your worst offenders at the top of the report.
Another underused trick is combining conditional formatting with INDIRECT for cross-sheet duplicate detection. If you have a master list on Sheet1 and a new import on Sheet2, you can highlight values on Sheet2 that already exist on Sheet1 by writing a custom rule with the formula =COUNTIF(Sheet1!$A:$A,A2)>0. This is incredibly useful for deduplicating new leads against an existing CRM export before you upload them, saving you from importing the same contact twice and triggering duplicate detection errors in your CRM platform.
If you need to identify the exact rows that should be deleted, add a rank column with the formula =COUNTIF($A$2:A2,A2). This returns 1 for the first occurrence of each value, 2 for the second, 3 for the third, and so on. Filter the rank column to show only values greater than 1, and you instantly see every row Excel would delete if you ran Remove Duplicates, giving you a chance to review and override the decision row by row before any data disappears from your workbook permanently.
For data that updates regularly, consider promoting your range to a formal Excel Table using Ctrl+T. Tables automatically extend your conditional formatting rules to new rows as you add data, so you never have to re-apply the duplicate highlight after pasting in fresh records. Tables also give you structured references like Table1[Email] that make COUNTIF formulas more readable and self-documenting, which pays dividends when you revisit a workbook six months later and need to remember what each formula does.
When you freeze a row in Excel to keep headers visible while scrolling through duplicate-flagged data, the workflow becomes dramatically smoother on long lists. Click View, Freeze Panes, Freeze Top Row, and the header stays anchored at the top no matter how far down you scroll. Combine this with conditional formatting and a filter, and you have a professional review interface for any dataset, from a few hundred rows to the full Excel limit of 1,048,576 rows per worksheet.
Finally, never underestimate the power of a simple manual review after using automated tools. Sort your data by the column you flagged, scan the highlighted cells, and ask whether each one actually represents a duplicate or a coincidental match. Real-world data is messy, and Excel cannot distinguish between two customers named John Smith at different addresses or two products with the same SKU in different warehouses. The combination of automated highlighting and human judgment is what separates a clean dataset from one that creates downstream problems in reports.
Once you have marked, reviewed, and decided how to handle each duplicate, document your process in a notes sheet inside the workbook. Record which columns you evaluated, what formulas you used, how many duplicates you found, and how many you ultimately removed. This audit trail is invaluable when stakeholders question your numbers, when you need to repeat the process next quarter, or when a colleague inherits the workbook and needs to understand exactly how the data was cleaned before they trust the final figures it contains.
The final piece of mastering duplicate marking in Excel is building muscle memory for the keyboard shortcuts and menu paths so you can execute the workflow in under thirty seconds on any dataset. Press Ctrl+A to select all data in a region, then Alt+H, L, H, D to walk through Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values without touching the mouse. This sequence works in every version of Excel from 2010 onward and becomes second nature after a dozen repetitions on real data.
For Remove Duplicates, the shortcut sequence is Alt+A, M, which opens the dialog from the Data tab. Always preview the highlight first using the conditional formatting workflow above, then run the removal only after you have visually confirmed the flagged cells. Combining these two shortcuts into a routine, highlight first then remove, is the single best habit you can develop to avoid costly data loss on important client deliverables and internal reports that downstream teams depend on for decisions.
If you find yourself marking duplicates on the same kind of dataset every week, record a macro of your full workflow. Click View, Macros, Record Macro, give it a name like FlagDuplicates, execute your steps once, and stop recording. From then on, you can replay the entire process with a single click or assigned keyboard shortcut. The macro will reapply the exact same conditional formatting rule, filter, and color choice every time, ensuring consistency across reports that multiple analysts on your team might run independently.
For team environments, consider centralizing your duplicate-checking workflow in a shared template file stored on OneDrive or SharePoint. Include a hidden instructions sheet with screenshots, the standard formulas your team uses, the columns to evaluate, and the color conventions for different duplicate severities. New team members can copy the template, drop in their data, and produce consistent results without having to reinvent the methodology each time, which dramatically reduces training time for incoming analysts and interns who join the team.
When presenting cleaned data to executives or clients, always include a brief note about how duplicates were identified and removed. A single line like "547 rows after removing 23 duplicates based on email match" gives stakeholders the confidence that your numbers are trustworthy and reproducible. This kind of transparency separates polished analyst work from raw spreadsheet output and is increasingly expected in environments where data governance and audit compliance are scrutinized by leadership and external auditors throughout the year.
Excel is constantly evolving, and Microsoft 365 subscribers regularly receive new features that simplify duplicate handling further. The UNIQUE, FILTER, and SORT functions released in 2020 transformed how analysts deduplicate data, allowing you to extract a clean list of unique values into a spillover range with a single formula like =SORT(UNIQUE(A2:A1000)). Keep an eye on Microsoft's release notes and the Excel blog for new functions, because each release adds tools that make duplicate detection faster, more elegant, and less reliant on the older helper-column techniques.
With the methods covered in this guide, you now have a complete toolkit for marking duplicates in Excel ranging from a five-second conditional formatting click to advanced multi-column case-sensitive detection with Power Query refreshable transformations. Choose the right tool for the job based on dataset size, frequency of use, and the consequences of getting it wrong. Practice on your real data this week, build the keyboard-shortcut muscle memory, and you will never again fear a messy customer list or a duplicate-riddled inventory export landing in your inbox on a Monday morning.
Excel Questions and Answers
About the Author
Business Consultant & Professional Certification Advisor
Wharton School, University of PennsylvaniaKatherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.