The example data
Every method below uses this small contact list. Ana Lopez and Cara Diaz each appear twice with the same email. Ben Ward appears twice too, but with two different emails, so whether he counts as a duplicate depends on which columns you compare.
| A | B | |
|---|---|---|
| 1 | Name | |
| 2 | Ana Lopez | ana@shop.com |
| 3 | Ben Ward | ben@mail.com |
| 4 | Ana Lopez | ana@shop.com |
| 5 | Cara Diaz | cara@web.com |
| 6 | Ben Ward | ben.w@work.com |
| 7 | Dev Patel | dev@mail.com |
| 8 | Cara Diaz | cara@web.com |
Method 1: the Remove duplicates tool
This is the quickest way, and it changes your data in place. Use it when you’re sure you want the extra rows gone.
- Select the data, including the header row. Here that’s
A1:B8. Click a column letter to select a whole column. - Open Data > Data cleanup > Remove duplicates.
- Tick Data has header row so your headings aren’t compared as data.
- Under Columns to analyze, leave Select all ticked to remove rows that match in every column. Or tick only the columns that should decide, for example just Email.
- Click Remove duplicates. Sheets tells you how many duplicate rows it removed and how many unique rows are left.
On the example, comparing both columns removes rows 4 and 8 and leaves 5 rows. If you analyze only the Name column, Ben Ward’s second row goes as well, even though his email is different, and 4 rows are left.
The tool keeps the first copy of each row and deletes the later ones. If you removed too much, press Ctrl+Z (Cmd+Z on a Mac) straight away, or restore an earlier copy from File > Version history.
Duplicates that differ by a stray space aren’t treated as the same. Run Data > Data cleanup > Trim whitespace on the range first, or clean a column with TRIM.
Method 2: UNIQUE, to keep the original
The UNIQUE function builds a deduplicated copy of a range and leaves the original alone. It updates by itself when the source changes, which makes it the better choice for lists that keep growing.
Click an empty cell with room below it, such as D2, and type:
=UNIQUE(A2:B8)Returns the 5 distinct rows. UNIQUE fills the cells below and to the right on its own, so keep them empty.
Give it one column to get the distinct values in that column:
=UNIQUE(A2:A8)Returns Ana Lopez, Ben Ward, Cara Diaz and Dev Patel.
Useful variations
- Sorted:
=SORT(UNIQUE(A2:A8))returns the distinct names in A to Z order. See SORT. - A whole column that keeps growing:
=UNIQUE(A2:A)also picks up rows you add later, but it adds one blank result for the empty cells.=UNIQUE(FILTER(A2:A, A2:A<>""))leaves the blanks out. See FILTER. - Values that appear only once:
=UNIQUE(A2:A8, FALSE, TRUE)returns just Dev Patel, the only name that isn’t repeated.
UNIQUE is case sensitive, so ana@shop.com and Ana@Shop.com both stay. To compare them as the same, clean them as you go: =UNIQUE(ARRAYFORMULA(LOWER(TRIM(B2:B8)))).
If you want the clean list to replace the original, copy the UNIQUE results, then paste them over the old data with Edit > Paste special > Values only (Ctrl+Shift+V). Pasting values matters: a pasted formula would point back at the data you’re replacing.
Method 3: highlight duplicates with COUNTIF
Sometimes you want to see the repeats before deciding what to do with them. Conditional formatting with COUNTIF colors every value that appears more than once.
- Select the range to check, for example
A2:A8. UseA2:Ato cover rows you add later. - Open Format > Conditional formatting.
- Under Format cells if, choose Custom formula is.
- Enter
=COUNTIF($A$2:$A,A2)>1. - Pick a fill color and click Done.
The formula counts how many times the value in each cell appears in the column. More than once means it’s a duplicate. The dollar signs lock the range so it stays the same for every row, while A2 has none, so it moves down to A3, A4 and so on as the rule checks each cell.
| A | B | |
|---|---|---|
| 1 | Name | |
| 2 | Ana Lopez | ana@shop.com |
| 3 | Ben Ward | ben@mail.com |
| 4 | Ana Lopez | ana@shop.com |
| 5 | Cara Diaz | cara@web.com |
| 6 | Ben Ward | ben.w@work.com |
| 7 | Dev Patel | dev@mail.com |
| 8 | Cara Diaz | cara@web.com |
Highlight only the extra copies
To leave the first copy plain and mark only the ones you’d delete, count from the top down to the current row instead of the whole column:
=COUNTIF($A$2:A2,A2)>1Only the start of the range is locked, so the range grows by one row each time. Rows 4, 6 and 8 light up.
Highlight the whole row, matching on two columns
Select A2:B8 and use COUNTIFS to require a match in both Name and Email. The $ before each column letter keeps every cell in the row looking at the same columns:
=COUNTIFS($A$2:$A,$A2,$B$2:$B,$B2)>1Highlights rows 2, 4, 5 and 8. Ben Ward’s rows stay plain, because his emails differ.
COUNTIF ignores capitals, so it treats “Ana Lopez” and “ana lopez” as the same, even though UNIQUE keeps both. That makes the highlight a good way to spot near duplicates that UNIQUE would miss.
For more ways to color repeats, like comparing two lists or matching capitals exactly, see how to highlight duplicates in Google Sheets.
Count how many duplicates you have
Before you clean a long list, it helps to know how big the problem is. Subtract the number of distinct values from the number of entries:
=COUNTA(A2:A8)-COUNTUNIQUE(A2:A8)Returns 3: there are 7 names but only 4 different ones, so 3 are repeats.
COUNTA counts the filled cells and COUNTUNIQUE counts each distinct value once.
Which method should you use?
- A one-off clean-up: the Remove duplicates tool. It’s fast, but it deletes rows.
- A list that keeps changing, like form responses or an export you refresh: UNIQUE in another column or tab, so the clean copy stays up to date.
- You’re not sure what counts as a duplicate yet: highlight with COUNTIF first, look, then remove.
Frequently asked questions
Does Remove duplicates keep the first row?
Yes. Google Sheets keeps the first copy of each duplicate row and deletes the ones below it. Sort your data first if you want a particular copy, such as the newest, to be the one that stays.
How do I remove duplicates without deleting any data?
Use the UNIQUE function in an empty column or another tab, for example =UNIQUE(A2:B100). It returns a deduplicated copy and leaves the original exactly as it was.
Is UNIQUE case sensitive in Google Sheets?
Yes. UNIQUE treats “Ana” and “ana” as different values. Wrap the range in LOWER or PROPER inside ARRAYFORMULA to compare them as the same. COUNTIF, on the other hand, ignores case.
Why aren’t my duplicates being found?
Usually because the values aren’t exactly the same: an extra space at the start or end, different capitals, or a number stored as text in one cell and as a number in another. Run Data > Data cleanup > Trim whitespace, then try again.
How do I find duplicates across two columns or two lists?
To match rows on two columns, use COUNTIFS, for example =COUNTIFS($A$2:$A,$A2,$B$2:$B,$B2)>1 as a conditional formatting rule. To find values in list A that also appear in list B, use =COUNTIF($B$2:$B,A2)>0.