📋 Find and Remove Duplicate Rows in Google Sheets
1. Overview
\[ \begin{array}{l} \textbf{Google Sheets provides multiple ways to detect and remove duplicate rows.} \\ \text{You can use formulas, built-in cleanup tools, or Google Apps Script automation.} \\ \textbf{Removing duplicates ensures cleaner datasets, accurate reports, and reliable analysis.} \end{array} \]
2. Use Cases
- Cleaning imported datasets with repeated entries - Removing duplicate signups or survey responses - Preparing mailing lists by keeping unique emails - Deduplicating product catalogs or inventory sheets - Ensuring accurate analytics by avoiding double counts Deduplication is essential for maintaining data integrity and preventing reporting errors. 3. Quick Method: Built-in “Remove Duplicates”
Steps: 1) Select the range of data (or the entire sheet). 2) Go to Menu → Data → Data cleanup → Remove duplicates. 3) Choose columns to check for duplicates. 4) Confirm removal (Sheet shows how many duplicates were deleted). This is the fastest method and works well for one-time cleaning tasks. 4. Formula Method (Mark or Filter Duplicates)
Use COUNTIF to mark duplicates: =COUNTIF(A:A, A2) > 1
• Returns TRUE if the value in A2 appears more than once.
• Apply to a helper column, then filter or delete rows manually.
Use UNIQUE to extract only distinct values:
=UNIQUE(A2:A)
• Produces a cleaned list without duplicates.
Formula-based methods are flexible for highlighting, reviewing, or exporting unique records.
5. Conditional Formatting for Visual Detection
Steps: 1) Select the column or range to check. 2) Format → Conditional formatting. 3) Apply custom formula: =COUNTIF(A:A, A1) > 1 4) Choose a highlight color.
Result: All duplicate values are highlighted instantly.
This method is useful when you want to visually inspect duplicates without deleting them.
6. Advanced Automation with Apps Script
Workflow: - Write an Apps Script to loop through rows - Check for duplicate keys (e.g., email, ID, or full row content) - Remove or mark duplicates automatically - Log results in a separate sheet for review This is helpful for recurring cleanup tasks, especially on large datasets. 7. Best Practices
- Always back up your Sheet before removing duplicates - Decide whether you want to keep the first occurrence or remove all - For large datasets, use helper columns before deletion - If duplicates are partial (same email but different names), decide merge rules - Automate with Apps Script if duplicates occur regularly \[ \begin{array}{l} \textbf{Combine quick cleanup tools with formulas and automation} \\ \text{to keep your Google Sheets accurate, reliable, and well-structured.} \end{array} \]