Yes, you can search for duplicates in Google Sheets using built-in functions like COUNTIF, UNIQUE, and FILTER, or with conditional formatting to highlight them visually. The fastest method for most users is to apply conditional formatting to a range, which instantly colors duplicate entries without altering your data.
Why Duplicates Are a Common Problem
Duplicate data sneaks into spreadsheets through copy-paste errors, merged lists, manual entry, or imported data from multiple sources. A single duplicate can skew totals, misdirect mail merges, or cause a VLOOKUP to return the wrong value. Understanding how to find and remove duplicates is a core spreadsheet skill, and Google Sheets offers several approaches depending on whether you want to see, count, or delete them.
Method 1: Conditional Formatting to Highlight Duplicates
This is the visual approach—it colors duplicate cells so you can spot them at a glance.
- Select the range you want to check (e.g.,
A2:A100). - Click Format > Conditional formatting.
- Under “Format cells if,” choose Custom formula is.
- Enter:
=COUNTIF($A$2:$A$100, A2)>1(adjust the range to match your selection). - Set a formatting style (e.g., yellow fill) and click Done.
This formula counts how many times each cell’s value appears in the entire range. If the count is greater than 1, the cell gets highlighted. The dollar signs ($) lock the range so the formula applies correctly to each row. On Excel for Windows, the path is Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, which is simpler but less flexible.
Method 2: Using COUNTIF to Count Occurrences
If you need a numeric count of how many times each value appears, add a helper column.
Assume your data is in A2:A20. In cell B2, enter:
=COUNTIF($A$2:$A$20, A2)
Drag the fill handle down to copy the formula. Cells showing a number greater than 1 indicate duplicates. For example, if “apple” appears in A2, A5, and A9, the formula returns 3 for each of those rows. This method is useful when you want to filter by count later.
Method 3: UNIQUE to Extract a De-duplicated List
Instead of marking duplicates, you can generate a clean list of unique values. The UNIQUE function does this in one step.
In cell D1, enter:
=UNIQUE(A2:A20)
This spills a list of all distinct values from A2:A20 into column D, removing duplicates automatically. If your data has headers, include them in the range or use =UNIQUE(A1:A20) and ignore the first row. This is a non-destructive way to create a reference list for dropdowns or further analysis.
Method 4: FILTER + COUNTIF to List Only Duplicates
To see a list of only the duplicated values (not the originals), combine FILTER with COUNTIF.
In cell F1, enter:
=UNIQUE(FILTER(A2:A20, COUNTIF(A2:A20, A2:A20)>1))
This works by first using COUNTIF to create an array of counts for each cell, then FILTER keeps only rows where the count is greater than 1, and UNIQUE removes repeated values from that filtered list. The result is a compact list of every value that appears more than once. Note that UNIQUE, FILTER, and dynamic arrays are available in Google Sheets and Excel 365, but not in older Excel versions.
Removing Duplicates Permanently
If you want to delete duplicate rows entirely, Google Sheets has a built-in tool.
- Select the data range (including headers).
- Click Data > Data cleanup > Remove duplicates.
- Choose which columns to check (if you select multiple, a row is removed only when all selected columns match).
- Click Remove duplicates.
This permanently deletes rows, so it’s wise to make a copy of your sheet first (right-click the sheet tab > Duplicate). Excel’s equivalent is Data > Remove Duplicates.
Comparing Google Sheets and Excel for Duplicate Detection
Both tools have similar capabilities, but the interfaces differ. Google Sheets relies on formulas and conditional formatting for most tasks, while Excel offers a dedicated “Duplicate Values” quick rule. Excel’s Remove Duplicates dialog is more flexible for selecting multiple columns. Google Sheets’ dynamic array functions (UNIQUE, FILTER) are just as powerful, but Excel users may need to press Ctrl+Shift+Enter for array formulas in older versions (Excel 365 handles them automatically). For large datasets (tens of thousands of rows), both perform adequately, but Excel may be faster on very large files.
Common Pitfalls and Misconceptions
- Case sensitivity: Both
COUNTIFandUNIQUEare case-insensitive by default. “Apple” and “apple” are treated as the same. If you need case-sensitive matching, you’d need a more complex formula usingEXACT. - Leading/trailing spaces: “apple ” and “apple” are considered different. Use
=TRIM(A2)in a helper column to normalize. - Blank cells:
COUNTIFcounts empty cells as duplicates if your range includes blanks. To ignore blanks, use=IF(A2="","",COUNTIF($A$2:$A$20,A2)). - Whole rows vs. single columns: Conditional formatting only checks the selected range. To find rows where multiple columns match, you need a different formula like
=COUNTIFS($A$2:$A$20,$A2,$B$2:$B$20,$B2)>1.
Frequently Asked Questions
How do I highlight duplicates in Google Sheets without deleting them?
Use conditional formatting as described in Method 1. It’s non-destructive and updates automatically when you add new data.
Can I find duplicates across multiple columns at once?
Yes. Use COUNTIFS instead of COUNTIF. For example, to check columns A and B together, use =COUNTIFS($A$2:$A$20,$A2,$B$2:$B$20,$B2)>1 in conditional formatting.
Why does my COUNTIF formula return 0 for a value I know is there?
Check for invisible characters like spaces, or that the cell format isn’t text. Use =TRIM(A2) to clean, or ensure the range in the formula matches your data exactly.
Is there a way to find duplicates in Google Sheets on mobile?
The Google Sheets mobile app supports conditional formatting and formulas, but the interface is limited. You can apply the same formulas on the web version, then view the highlights on mobile.
What is the fastest method for a list of 10,000 rows?
Use UNIQUE to create a de-duplicated list, or use Remove duplicates if you want to delete. Conditional formatting on 10,000 rows may slow down the sheet, so consider using a formula-based approach instead.
Related
- Random Number Generator Code in Python, C, and Excel
- Ctrl Cut Shortcut: How to Cut Text Fast
- What Does Data Entry Include? Full Scope
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Split Character Array in MATLAB: Methods and ExamplesTo split a MATLAB character vector at a delimiter, use strsplit: for example, parts = strsplit('red,green,blue', ','); returns…
- Excel Daylight Saving Time: How Dates and Hours WorkExcel does not automatically apply daylight saving time (DST) rules to a date or time. It stores date-and-time…
- Excel Auto Group Rows: How to Group and UngroupExcel can automatically group rows when it finds summary formulas linked to detail rows: select a cell in…
- Reselling Inventory Spreadsheet: Track Stock and ProfitA reselling inventory spreadsheet is a workbook for recording what you buy, what remains in stock, and what…
- Cannot Save As in Excel? Causes and FixesIf you cannot use Save As in Excel, open File > Save As and choose Browse to save…
- Microsoft Excel Named Ranges: How They Work and HelpMicrosoft Excel named ranges are labels you assign to cells or ranges so you can refer to them…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.