Removing duplicates is safe when you do three things first: define what counts as a duplicate, copy the original data, and decide which record survives. Skip any of these and the usual outcome is a clean-looking sheet with the wrong rows gone, and no obvious way to get them back.
This guide covers Excel and Google Sheets, the built-in removal tools, formula-based alternatives, and the checks that protect your data. A worked example with six rows shows each step.
Define What a Duplicate Is
Every removal starts with a definition of the duplicate. Get this wrong and the rest of the process removes the wrong rows, however carefully you run it.
SOP 2.1: Choose the key columns
- List the columns that identify a real-world record. For a customer list this is often the email address. For a product list it may be the SKU.
- Decide whether the key is one column or several. Two customers can share a name but have different emails, so “name” alone is a weak key.
- Write the key down before you open the removal tool. Include it in the sheet’s notes tab if others will use the file.
SOP 2.2: Normalise values before comparing
Spreadsheet tools compare cells literally, but people do not enter data literally. Before you remove anything, check for these differences:
- Leading and trailing spaces: “ben@example.com ” and “ben@example.com” look identical but are different values to the tool. The Excel Remove Duplicates feature may treat them as distinct.
- Capitalisation: Excel’s Remove Duplicates ignores case, so “Ana@Example.com” and “ana@example.com” match. Some formulas, such as EXACT, do not. Check which behaviour your method uses.
- Numbers stored as text: “00123” and 123 can look alike but compare differently. Postcodes and product codes with leading zeros are the usual cases.
- Dates entered in two formats: “03/04/2024” may be 3 April or 4 March depending on locale.
To normalise, add a helper column with =TRIM(LOWER(C2)) for an email column, fill it down, and compare that column instead of the raw one. Do not overwrite the original values until you have checked the result.
Skip the setup
Every client, lead and follow-up in one sheet, with drop-downs and status colours already set up.
Choose a Removal Method
There is no single best method. The right one depends on whether you need to keep the original sheet intact, whether you are on a version that supports dynamic arrays, and how many rows you are processing.
| Method | Where it works | Changes source data? | Best use | Main risk |
|---|---|---|---|---|
| Remove Duplicates (built-in) | Excel, Google Sheets | Yes, permanently | Quick clean of a copy | Deletes rows with no preview |
| UNIQUE formula | Excel 365, Google Sheets | No, returns a new range | Building a deduplicated view | Compares whole rows by default |
| Flag with COUNTIF, then filter or delete | Excel, Google Sheets | No until you act | Auditing before removal | Manual steps, easy to misfilter |
| Power Query (Remove Duplicates) | Excel for Windows and Mac | No, output is a new table | Repeatable imports | Needs a refresh step each time |
SOP 3.1: Use Remove Duplicates in Excel
- Copy the data to a new sheet, or confirm you have a backup.
- Click any cell inside the table or range.
- Open the Data tab and select Remove Duplicates in the Data Tools group.
- Tick My data has headers if row 1 contains column names. Without this, the header row may be treated as data.
- Untick every column except the key columns. Only the ticked columns are compared.
- Select OK. Excel reports how many duplicates were removed and how many unique values remain.
Excel keeps the first occurrence in the sheet and deletes later ones. The sheet order determines which row survives, so sort first if you need a different row to remain.
SOP 3.2: Use Remove duplicates in Google Sheets
- Duplicate the sheet tab first using the tab’s menu, then work on the copy.
- Select the range, including the header row.
- Open Data, then Data cleanup, then Remove duplicates.
- Tick Data has header row if applicable.
- Choose the columns to compare. Google Sheets treats the whole row as the comparison unless you narrow the selection.
- Select Remove duplicates. Sheets reports how many rows were removed.
The removal is permanent once the dialogue closes. Ctrl+Z (or Cmd+Z on Mac) will reverse it in the current session, but do not rely on that after you have closed the file or made further edits.
SOP 3.3: Build a deduplicated view with UNIQUE
The UNIQUE function returns distinct rows without changing the source data. In Excel 365 and Google Sheets, enter this in an empty cell:
=UNIQUE(A2:D7)
The result spills into the cells below and to the right. Three points to note:
- UNIQUE compares entire rows. A row with the same email but a different plan is treated as distinct.
- Do not type into any cell inside the spill range. Doing so produces a #SPILL! error in Excel.
- In Google Sheets, the equivalent behaviour is available with the same function name, and the result updates when the source changes.
SOP 3.4: Flag duplicates before removing them
Flagging is the most reliable method when you need to inspect what will be removed. Add a helper column, for example column F, and enter this in F2:
=COUNTIF($E$2:E2,E2)>1
This returns TRUE for the second and later occurrences of a value in column E, and FALSE for the first. Fill it down. Then:
- Filter column F for TRUE.
- Read the rows. Confirm each one is a real duplicate and not a near match that should be kept.
- Delete the filtered rows, or copy the FALSE rows to a new sheet.
COUNTIF is not case-sensitive and does not trim spaces, so run it on the normalised helper column from SOP 2.2 if your data is messy.
SOP 3.5: Use Power Query for repeatable clean-ups
If the same file arrives every week, Power Query can remove duplicates automatically on refresh. In Excel for Windows, load the data with Data, then Get Data. In the Power Query Editor, select the key columns, open the Home tab, and choose Remove Rows, then Remove Duplicates. Close and load the result to a new table.
The source file is untouched. The cleaned table is rebuilt each time you refresh. The cost is setup time and the need to remember to refresh.
Protect the Data Before You Touch It
Most data loss comes from skipping this module. It takes two minutes and makes every other method reversible.
SOP 4.1: Create a recoverable copy
- Save the file under a new name with a date, for example
customers_2024-06-03_before-dedupe.xlsx. - Within the file, duplicate the working sheet so that the original is preserved alongside the cleaned version.
- Note the row count before you start. In Excel, select column A and read the count in the status bar. In Sheets, use
=COUNTA(A:A). - Keep the original until the cleaned version has been checked against the source and used successfully downstream.
SOP 4.2: Check for hidden conditions
- Clear all filters. A filtered range may behave differently from the visible data you expect.
- Unhide any hidden rows and columns. Hidden rows can be removed without being seen.
- Confirm there are no merged cells in the table. Merged cells break both sorting and removal.
- Check whether other sheets or formulas refer to rows in this sheet. Deleting rows can make those references return errors or point to the wrong data.
Decide Which Record to Keep
Removing a duplicate is also a decision about which version of a record is correct. The built-in tools make the decision by position, keeping the first occurrence. That is only the right choice when the first row is also the best one.
SOP 5.1: Apply a keep rule
Write one rule before you remove anything. Common rules include:
- Keep the most recent: sort by a timestamp or ID descending, then remove duplicates. The first row remaining is the newest.
- Keep the most complete: count non-blank cells per row with
=COUNTA(A2:D2), sort by that count, then remove duplicates. - Keep the record from the authoritative source: add a source column and sort so that your preferred source comes first.
- Merge rather than delete: where each duplicate holds a different useful field, copy the missing values into the surviving row first, then remove the rest.
If you cannot state the rule in one sentence, stop and ask the data owner. Removing the wrong row is harder to notice than leaving a duplicate in place.

Ready-made template
Binsight Inventory Spreadsheet
Stock in, stock out and reorder alerts that turn red before you run out. Uses lookups and conditional formatting.
Worked Example
This example uses a fictional customer list of six rows. The task is to remove duplicate customers by email address, keeping the most recent record (the highest ID), and treating differences in spacing and capitalisation as the same email.
Before:
| ID | Name | Plan | |
|---|---|---|---|
| 101 | Ana Lopez | ana.lopez@example.com | Basic |
| 102 | Ben Shah | ben@example.com | Pro |
| 103 | Ana Lopez | Ana.Lopez@example.com | Pro |
| 104 | Chloe Wu | chloe@example.com | Basic |
| 105 | Ben Shah | ben@example.com | Pro |
| 106 | Dev Patel | dev@example.com | Basic |
Note that 105 has a trailing space in the email in the source file, which the table above does not show. That is the kind of difference that causes the built-in tool to miss a match.
Step 1: Normalise the key
Add a helper column G with this formula in G2, filled down:
=TRIM(LOWER(C2))
Every email now compares cleanly. Rows 101 and 103 both become ana.lopez@example.com. Rows 102 and 105 both become ben@example.com.
Step 2: Sort so the keep rule works
Sort by ID descending. The most recent records now sit at the top: 106, 105, 104, 103, 102, 101.
Step 3: Remove duplicates on the normalised key
Copy the sorted data to a new sheet. Run Remove Duplicates on column G only. Because the newest record sits first, the first occurrence of each email is the record to keep.
Result: rows 105 (Ben Shah), 103 (Ana Lopez), 104, and 106 survive. Rows 102 and 101 are removed.
After:
| ID | Name | Plan | |
|---|---|---|---|
| 106 | Dev Patel | dev@example.com | Basic |
| 105 | Ben Shah | ben@example.com | Pro |
| 104 | Chloe Wu | chloe@example.com | Basic |
| 103 | Ana Lopez | Ana.Lopez@example.com | Pro |
Step 4: Check the result
- The count dropped from six to four, with two removals, which matches the expected outcome.
- The surviving Ana Lopez record carries the Pro plan from row 103, which is correct if the plan changed after sign-up.
- Row 101 is gone. Confirm that nothing else in the workbook depended on ID 101 before you delete the original rows.
If the Basic plan on row 101 had been the correct value, the keep rule was wrong, not the tool. That is why the rule is written down first.
Import and Export Checkpoints
Duplicates often arrive through an import and leave through an export. Check both ends.
SOP 10.1: Before import
- Open the source CSV in a plain text editor, not a spreadsheet, to see the raw values and delimiters.
- Confirm the encoding is UTF-8 if the names include accents, for example “José” or “Łukasz”. Mis-encoded names can make the same person look like two different people.
- Check whether the file already contains duplicates, and whether the source system has a unique ID you can use as the key.
SOP 10.2: After import, before export
- Run the normalisation from SOP 2.2 on the imported key columns.
- Remove or flag duplicates following Module 3.
- Confirm the row count against the expected number from the source.
- Format identifier columns as text so that leading zeros survive the export.
SOP 10.3: Export
- Export to CSV using File, then Save as or Download, choosing the CSV format.
- Note that CSV holds values only. Formulas, formatting and the helper columns are lost, which is usually what you want for a clean feed.
- Open the exported file in a text editor and check the first few rows and the last row. Confirm the header row and that no stray rows were added.
- Keep the exported file with the dedupe log, including the date, the key used, and the number of rows removed.
Decision Rule and Checklist
Use this rule to pick a method: if you need to see what will be removed, flag it first. If you need the result repeatably, build a view or a query. If you need speed on a disposable copy, use the built-in tool.
Before you run any removal, confirm each item:
- The key columns are written down.
- Keys are normalised for spaces, case and number formats.
- A dated copy of the original exists.
- Filters are cleared and hidden rows are checked.
- The keep rule is stated in one sentence.
- The header checkbox matches the data.
- The row count before removal is recorded.
- Dependent sheets and formulas have been checked.
After removal, confirm the row count matches the expected figure, spot-check the surviving records against the source, and export only after the checks pass.