Sub topic 7
Remove duplicate rows with the Remove duplicates tool
Assume you can select ranges, use the Google Sheets menu bar, and enter simple formulas. This chapter focuses on finding repeated records after your data is in a table with one header row.
Duplicate rows are records that repeat the same values in the columns you use to identify a record. For example, two rows with the same customer ID may represent one customer entered twice. Duplicate rows can inflate counts, distort pivot tables, and make imports appear larger than they are.
Choose what counts as a duplicate
Google Sheets compares the columns in the selected range. You can compare every column or only the columns that define identity.
| Comparison choice | Example | Result |
|---|---|---|
| Every column | Name, email, and status | Rows must match in all selected columns |
| Selected columns | Email only | Rows with the same email are duplicates |
| One identifier | Customer ID | Repeated IDs are flagged as repeated records |
A row with the same email but a different status is not a duplicate when every column is selected. It is a duplicate when only the email column is selected. Choose the columns according to the question you are answering.
Protect the original data
The Remove duplicates tool changes the selected range. Make a copy of the sheet first, or duplicate the tab:
- Right-click the sheet tab.
- Select Duplicate.
- Give the copy a name such as Cleaned data.
Keep the original tab unchanged. This gives you a reference when a repeated row contains a legitimate update rather than an accidental repeat.
Remove duplicates from a range
Suppose A1:C6 contains headers in row 1 and customer records below it.
- Select the complete range, including the headers.
- Open Data, then select Data cleanup, then Remove duplicates.
- Select Data has header row if the first row contains labels.
- Select the columns that define a duplicate.
- Select Remove duplicates.
- Read the result summary. Sheets reports how many duplicate rows it removed and how many unique rows remain.
When all three columns are selected, Sheets keeps the first occurrence of an identical row and removes later occurrences. When only Customer ID is selected, a later row with the same ID is removed even if another column differs.
Review the remaining rows instead of assuming every removal was correct. A repeated identifier may indicate a real problem, such as two transactions belonging to one customer. In that case, removing a row would destroy information.
Decide before deleting
Use the tool when you want a one-time change to a working copy. Do not use it as the only record of a recurring import. For recurring work, first preserve the raw data and create a separate cleaned table. A formula-based method such as UNIQUE can produce a refreshed result without changing the source, but it also needs review when duplicates contain conflicting values.
Exercise
Your table has columns Customer ID, Email, and Status. Two rows share an email, but their statuses are different. Which columns should you select if you want to find one record per email, and what should you review before removing a row?
Show answer
Select the Email column. Review the differing statuses and confirm which record should remain before removing the other row.