How to remove duplicates based on criteria
Tutor 5 (87 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Removing duplicates based on criteria means filtering rows that repeat specific values while keeping only the rows that match a defined rule. Excel uses built-in tools and formulas to perform this task with consistent precision. Excel provides a direct feature for removing duplicate rows when a single rule or multiple rules define uniqueness.
Steps
Select the full range that contains the data.
Go to Data on the Ribbon.
Choose Remove Duplicates.
Select the columns that define the criteria.
Confirm with OK.
Key Details
Windows and Macbook use the same steps.
Remove Duplicates keeps the first occurrence and deletes the remaining entries.
Excel evaluates only visible cells when filtering is active.
How to remove duplicates based on multiple criteria using formulas
Formulas create dynamic lists that update as data changes. LaTeX formulas appear when required.
Create a list without duplicates
Use UNIQUE to extract distinct rows that meet defined criteria.
\text{=UNIQUE(FILTER(A2:D100, B2:B100="Active"))}
This formula returns unique rows from A2:D100 when column B equals “Active.”
Identify duplicates based on criteria
Use COUNTIFS to count how many times a combination appears.
\text{=COUNTIFS(A:A,A2, B:B,B2)}
A result greater than 1 means the row duplicates another row that shares the same values in columns A and B.
How to remove duplicates based on criteria with Advanced Filter
Advanced Filter gives more control when criteria use AND or OR logic without writing formulas inside the main table.
Steps
Create a criteria range above or beside the table.
Enter a header identical to the column header.
Enter the condition below the header.
Select the full dataset.
Open Data > Advanced.
Choose Filter in place or Copy to another location.
Check Unique records only.
Apply the filter.
Use Cases
Remove duplicates only when a status matches a specific value.
Create a unique list where only rows above a numeric threshold appear.
How to remove duplicates based on the earliest or latest date
A helper formula ranks entries and selects the first or last occurrence according to criteria.
Steps
Add a column that generates a ranking using a date column.
Filter to keep only rank 1.
Remove or hide helper columns.
Formula Example
\text{=IF(COUNTIFS(A:A,A2)>1, RANK(E2, FILTER(E:E, A:A=A2)), 1)}
This ranks dates in column E for each value in column A.
How to remove duplicates based on criteria with Power Query
Power Query handles structured transformations efficiently.
Steps
Select the data.
Go to Data > Get & Transform Data > From Table/Range.
Load data into Power Query.
Apply a filter to keep rows that meet your criteria.
Right-click the columns that define uniqueness.
Select Remove Duplicates.
Load the cleaned data back into the worksheet.
Advantages
Power Query produces repeatable processes.
Transformations stay stored as steps that can be refreshed.
Practical criteria examples
Keep only duplicates where a value appears more than twice.
Remove duplicates when a status equals “Approved.”
Keep the duplicate with the highest sales value.
Remove duplicates in one column while preserving unique combinations in another.
Common mistakes and how to avoid them
Selecting a single column when uniqueness depends on multiple columns.
Forgetting that Remove Duplicates deletes data permanently.
Using formulas without converting ranges to tables for dynamic growth.
Applying criteria incorrectly when the table contains merged cells.
Applying Remove Duplicates on filtered data without selecting visible rows only.
Excel removes duplicates successfully when the criteria define exactly how rows should be evaluated.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to show duplicates in red
Answers · 1
How to apply duplicate conditional formatting rule
Answers · 1
How to duplicate conditional formatting excel
Answers · 1
What is excel conditional formatting duplicates
Answers · 1