Blog
Remove Duplicates in Excel: 4 Ways and Which Columns to Pick
To remove duplicates in Excel is to delete every repeated row so only one copy remains. The button takes a second; choosing what counts as a duplicate is the real work. Remove on Last Name alone and the second Garcia in your class disappears from the roster. Remove on every column and the same student survives twice because one guardian phone number has a different format. Once the file is saved and closed, the deleted rows are gone, so settle the rule before you pick a method.
Four ways to remove duplicates, compared
| Method | Original data | Updates automatically | Available in |
|---|---|---|---|
| Data > Remove Duplicates | Deleted in place | No, run again | All versions |
| Advanced Filter, unique records only | Kept, results copied | No, run again | All versions |
| UNIQUE function | Kept | Yes | Microsoft 365, Excel 2021+ |
| COUNTIF flag, then filter and delete | Reviewed first | Formula updates | All versions |
For a list you clean once, Remove Duplicates is fastest. If the original must stay untouched, use Advanced Filter. If new rows arrive every week and you need a live unique list, use UNIQUE. If you want to look at each row before it goes, flag the rows with COUNTIF first.
How to choose the columns that define a duplicate
Write the rule as one sentence: "two rows are the same when…". The answer depends on the data.
Rosters and contact lists: use the student ID, not the name. Two students in the same grade can share a first and last name, and siblings share a last name and an address. For families or personal contacts, email or mobile number is a better key than the person's name.
Sign-up and form responses: a student ID alone is usually not enough, because a student who signs up for two clubs has two rows with the same ID. Tick student ID and activity together. If the same student submitted the form twice, once from a school email and once from a personal one, leave the email out of the key so the two submissions match.
Score lists: when each row is one score, the key is student ID plus assignment. Dropping the assignment from the key merges different quizzes for the same student and deletes real scores.
All columns: use this only to catch true copy-paste duplicates. It is the safest choice, but it leaves real duplicates behind whenever one cell differs. In a bank export for a personal budget, two $4.50 coffees on the same day are both real, so check identical transactions by eye instead of deleting them.
When you are not sure, count both candidates. If the student ID finds 212 duplicates and the name finds 226, the 14-row gap is your list of same-name, different-student rows to check before deleting anything.
Method 1: Data > Remove Duplicates

- Click any cell in the table, or select the range.
- On the Data tab, in the Data Tools group, click Remove Duplicates.
- Leave My data has headers checked if row 1 holds column names.
- Tick only the columns in your duplicate rule, then click OK.
A row is removed only if every ticked column matches an earlier row. The first occurrence stays, later ones are deleted, and Excel reports how many duplicates were removed and how many unique values remain. The Microsoft Learn reference for RemoveDuplicates defines the feature by exactly two things: which columns contain the duplicate information, and whether the first row is a header.
Two details catch people. Excel compares what each cell displays, not the stored value, so the same date formatted as 3/8/2026 in one row and Mar 8, 2026 in another counts as two different values; apply one format to the whole column first. And the comparison ignores case, so "ABC-100" and "abc-100" are treated as duplicates.
Because the top row survives, sort first to control which version you keep. Sort by Last Updated, newest to oldest, then remove duplicates, and the most recent record of each student is the one left.
Method 2: Advanced Filter, keeping the original
- Click inside the table and choose Data > Sort & Filter > Advanced.
- Select Copy to another location, confirm the List range and pick a Copy to cell.
- Check Unique records only and click OK.
The Microsoft Learn reference for AdvancedFilter describes the Unique option as filtering unique records only; when it is off, every record that meets the criteria comes through. Put a single column in the list range to get a unique list of that column, such as every student who signed up for at least one club. The Copy to cell must be on the active sheet, so start the command from the sheet where you want the results.
Method 3: the UNIQUE function
Microsoft 365 and Excel 2021 or later have UNIQUE:
=UNIQUE(A2:C500)
=UNIQUE(B2:B500,,TRUE)
The first formula spills every distinct combination of columns A to C. The third argument in the second formula returns values that appear exactly once, which is handy for spotting students who came to tutoring only once. Because it is a formula, new rows in the source show up in the result immediately, and =SORT(UNIQUE(B2:B500)) gives you an alphabetical list. Leave room below it: anything in the spill range causes a #SPILL! error.
In Excel 2016 or 2019, Power Query fills the same role for recurring files. Select the table, choose Data > From Table/Range, select the key columns in the Power Query Editor and click Home > Remove Rows > Remove Duplicates. Next week, paste in the new data and click Refresh All. Power Query's comparison is case-sensitive, so standardize text with Transform > Format > UPPERCASE first if codes are typed inconsistently.
Review before deleting: conditional formatting and COUNTIF

Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values colors every value that appears more than once without changing any data. It works one column at a time, so multi-column rules need a formula.
=COUNTIF($A$2:$A$8,A2) counts how often the value in A2 appears; 1 is unique, 2 or more is a duplicate. For a multi-column rule, use =COUNTIFS($A:$A,A2,$B:$B,B2). To flag only the second and later copies, use an expanding range: =COUNTIF($A$2:A2,A2). Filter that column for values above 1, review the rows, and delete them. You get the same result as Remove Duplicates, but you see every row before it goes.
👉 Find Duplicates in Excel: Highlight, Count and Compare Lists
Worked example: merging three sign-up lists
A middle school teacher who runs the after-school tutoring program collects sign-ups from three places: a Microsoft Forms export, a sheet the front office typed from paper forms, and lists sent by each grade-level team. She pastes all three into one sheet: 640 rows with student name, student ID, grade, guardian phone and Last Updated.
Her first idea was to remove duplicates on student name. A quick COUNTIF showed Jordan Lee three times, and one of those rows was a different Jordan Lee in sixth grade with his own student ID. Removing on name would have dropped a student from the program. She switched the key to student ID.
The IDs were not consistent either. Students typed S-004512 into the form, the office typed 004512, and one team's column was formatted as a number, so IDs starting with 0 had lost digits. A helper column with =TEXT(SUBSTITUTE(B2,"S-",""),"000000") turned every entry into the same six-digit text.
She sorted by Last Updated, newest first, copied the sheet as a backup, and ran Remove Duplicates with only the helper column ticked. The result: 212 rows removed, 428 unique students. Back in the backup, a COUNTIFS on student ID and guardian phone found 14 students whose phone number had changed between sign-ups, and she confirmed the newest numbers were the ones kept. Changing the key and normalizing the IDs took ten minutes and kept her from dropping a student from the program or calling a family at an old number.
FAQ
Q. Can I undo Remove Duplicates?
Yes, with Ctrl+Z before you close the file. After saving and closing, the rows are gone, so copy the sheet first.
Q. How do I keep the newest row instead of the first?
Sort by the date column, newest to oldest, before running Remove Duplicates. The first occurrence is kept, so the newest row wins.
Q. How do I list values that appear only once?
Use =UNIQUE(range,,TRUE). Without UNIQUE, filter a COUNTIF helper column for 1.
Q. Why did Remove Duplicates leave rows that look identical?
The cells differ in something you cannot see: a trailing space, a different date format or a number stored as text. Clean the key column with TRIM and a consistent format, then run it again.
Clean up sign-up lists with inline AI
inline AI opens the merged list on your PC. Say "remove duplicates on student ID, keep the most recently updated row and list what you removed on a new sheet," and it normalizes the IDs, separates the rows to delete from the rows to keep, and cleans the sheet, so you can see who was merged before you save.
Gradebooks and spreadsheets, finished by inline AI in the file itself.
Ask in one sentence for roll-ups, trackers and the cleanup you repeat every week. Your files never leave your computer.





