How to Count Duplicates in Google Sheets: per Value, Extra Rows, Unique Counts and Why the Numbers Disagree (2026)

“How many duplicates are there?” sounds like one number, but people mean at least four different things: how often each value appears, how many extra copies a dedupe would delete, how many rows are involved in any repeat, and how many distinct values repeat at all. Google Sheets can give you each of them, and the built-in functions disagree in one important way: some ignore upper and lower case and some don’t. This guide shows the formula for each number, a one-formula count table, two-column keys, and how to make your figure match what Data cleanup › Remove duplicates will actually remove.

The example

A Signups tab with a header row. Column A holds the email, column B the event.

A: EmailB: Event
2ana@x.comGala
3bo@x.comGala
4Ana@x.comGala
5cy@x.comPicnic
6bo@x.comPicnic
7ana@x.comPicnic
8dee@x.comGala

Treating Ana@x.com as the same person as ana@x.com, the four numbers for column A are:

QuestionAnswerWhy
How often does each email appear?ana 3, bo 2, cy 1, dee 1Count per value
How many extra copies are there?37 rows minus 4 distinct emails; what a dedupe removes
How many rows are part of a duplicate group?53 ana rows + 2 bo rows
How many emails repeat?2ana and bo

Before you start: stray spaces make bo@x.com and bo@x.com different values for every function here. Select the column and run Data › Data cleanup › Trim whitespace first (it does not trim non-breaking spaces).

Count how many times each value appears

Add a helper column. In C2, enter this and fill it down:

=COUNTIF($A$2:$A, A2)

For the example that gives 3, 2, 3, 1, 2, 3, 1. Any value above 1 is a duplicate, and you can filter or sort on column C. COUNTIF is not case sensitive, so the Ana@x.com row is counted with the two ana@x.com rows.

To number the copies instead (first, second, third occurrence), lock only the start of the range:

=COUNTIF($A$2:A2, A2)

That gives 1, 1, 2, 1, 2, 3, 1. Every row showing 2 or more is an extra copy, so =COUNTIF(C2:C, ">1") on this column returns 3. For one specific value, skip the helper column: =COUNTIF(A2:A, "ana@x.com") returns 3.

If you only want to look, not calculate: select the column and open Data › Column stats. The sidebar includes a frequency table of the most and least frequent values.

One formula: every value with its count

QUERY can group the column and count each group, sorted with the most repeated first. Put this in an empty column, for example E1, so the result fills E:F:

=QUERY({"Email"; ARRAYFORMULA(LOWER(TRIM(A2:A)))}, "select Col1, count(Col1) where Col1 <> '' group by Col1 order by count(Col1) desc, Col1 label count(Col1) 'Count'", 1)
E: EmailF: Count
ana@x.com3
bo@x.com2
cy@x.com1
dee@x.com1

The {"Email"; …} part builds a one-column table with a header, lowercased and trimmed, which is why the columns are called Col1 and why Ana@x.com joins the ana group. The final 1 tells QUERY there is one header row. Lowercasing also turns numbers into text, which avoids a QUERY quirk: in a column with mixed types, Google’s help says the minority type is treated as empty.

The plain version, without lowercasing, is shorter but splits case variants into separate groups (ana@x.com 2, Ana@x.com 1):

=QUERY(A1:A, "select A, count(A) where A is not null group by A order by count(A) desc label count(A) 'Count'", 1)

With the count table in E:F, the totals are one short formula each:

NumberFormulaExample
Emails that repeat=COUNTIF(F2:F, ">1")2
Rows in duplicate groups=SUMIF(F2:F, ">1")5
Extra copies=SUM(F2:F) - COUNT(F2:F)3
Distinct emails=COUNT(F2:F)4
Emails that appear once=COUNTIF(F2:F, 1)2

Prefer clicking to formulas? A pivot table gives the same list: select the data, choose Insert › Pivot table, then in the side panel click Add next to Rows and choose Email, and Add next to Values and choose Email again, summarized by COUNTA. Trim spaces first, and if your data mixes letter cases, check whether variants such as Ana@x.com get a row of their own.

Totals without a helper table

If you just want a number in one cell:

Distinct values, ignoring case and spaces (4):

=COUNTUNIQUE(ARRAYFORMULA(LOWER(TRIM(FILTER(A2:A, A2:A<>"")))))

Extra copies, the number of rows a dedupe would delete (3):

=COUNTA(A2:A) - COUNTUNIQUE(ARRAYFORMULA(LOWER(TRIM(FILTER(A2:A, A2:A<>"")))))

Rows that are part of a duplicate group (5). The A2:A<>"" part stops empty cells below the data from being counted as duplicates of each other:

=SUMPRODUCT((A2:A<>"")*(COUNTIF(A2:A, A2:A)>1))

Values that appear exactly once (2), using UNIQUE’s third argument, exactly_once:

=IFERROR(ROWS(UNIQUE(ARRAYFORMULA(LOWER(FILTER(A2:A, A2:A<>""))), FALSE, TRUE)), 0)

ROWS is used instead of COUNTA because when nothing qualifies UNIQUE returns an error, and COUNTA would count that error as 1; IFERROR turns it into 0.

Why the numbers disagree: case

This is the most common reason two “duplicate counts” don’t match:

ToolAna@x.com vs ana@x.com
COUNTIF, COUNTIFS, SUMPRODUCT with =Same value
Data › Data cleanup › Remove duplicatesSame value (Google’s help: cells that differ only in letter case, formatting or formulas count as duplicates)
COUNTUNIQUE, UNIQUE, QUERY group byDifferent values

So the popular shortcut =COUNTA(A2:A)-COUNTUNIQUE(A2:A) returns 2 for the example, while Remove duplicates deletes 3 rows. Wrapping the values in LOWER, as in the formulas above, makes them agree. If letter case really matters for your data, such as case-sensitive codes, go the other way and use EXACT for the per-row count:

=SUMPRODUCT(--EXACT($A$2:$A, A2))

For variants that differ in more than case (Gmail dots, phone formats, typos), see duplicates that don’t match exactly.

Count duplicates across two or more columns

When a duplicate means the same email and the same event, count with COUNTIFS, one range and criterion per column. Per row (2, 1, 2, 1, 1, 1, 1 in the example):

=COUNTIFS($A$2:$A, A2, $B$2:$B, B2)

Running version, where 2 or more marks an extra copy; =COUNTIF(C2:C, ">1") then counts them (1: the second ana/Gala row):

=COUNTIFS($A$2:A2, A2, $B$2:B2, B2)

Rows involved in a repeated combination (2):

=SUMPRODUCT((A2:A<>"")*(COUNTIFS(A2:A, A2:A, B2:B, B2:B)>1))

And a count table per combination, lowercased and trimmed like before:

=QUERY({"Email", "Event"; ARRAYFORMULA(LOWER(TRIM(A2:B)))}, "select Col1, Col2, count(Col1) where Col1 <> '' group by Col1, Col2 order by count(Col1) desc label count(Col1) 'Count'", 1)

Beware the shortcut =ROWS(A2:B8)-ROWS(UNIQUE(A2:B8)): UNIQUE compares whole rows with case, so it sees 7 distinct rows and reports 0, while Remove duplicates on both columns removes 1.

Count entries that are also on another list

To count how many rows of this list appear on an Archive tab (case-insensitive):

=SUMPRODUCT((A2:A<>"")*(COUNTIF(Archive!A2:A, A2:A)>0))

For matching, highlighting and pulling the overlapping rows, see compare two columns or two sheets.

Check your number against Remove duplicates, safely

Remove duplicates edits the data in place, but you can use it as a calculator on a copy. Right-click the tab and choose Duplicate, select the data on the copy, choose Data › Data cleanup › Remove duplicates, tick the columns that define a duplicate and whether the data has a header row, and click Remove duplicates. Sheets reports how many duplicate rows it removed and how many unique rows remain; that first number should equal your extra-copies figure. Then delete the copy. To actually clean the original and choose which row survives, see find and remove duplicates or keep the latest row per key.

Pitfalls

FAQ

How do I count how many times each value appears in Google Sheets?

Put =COUNTIF($A$2:$A, A2) next to the first row and fill it down; each row then shows how often its value appears in column A. For a list of each value once with its count, use QUERY with group by, or a pivot table with the column under Rows and again under Values summarized by COUNTA.

How do I count the number of duplicates in a column?

Decide which number you need. Extra copies (the rows Remove duplicates would delete) is the total minus the distinct values: =COUNTA(A2:A)-COUNTUNIQUE(ARRAYFORMULA(LOWER(TRIM(FILTER(A2:A, A2:A<>""))))). Rows that are part of any duplicate group is =SUMPRODUCT((A2:A<>"")*(COUNTIF(A2:A, A2:A)>1)).

Why does COUNTA minus COUNTUNIQUE give a different number than Remove duplicates?

COUNTUNIQUE and UNIQUE treat upper and lower case as different values, while Data cleanup › Remove duplicates treats cells that differ only in letter case as duplicates. Lowercase the values inside COUNTUNIQUE, as in the formula above, and the two numbers match.

Is COUNTIF case-sensitive in Google Sheets?

No. Google’s help says COUNTIF is not case sensitive, so ANA@x.com and ana@x.com are counted together. For a case-sensitive count use =SUMPRODUCT(--EXACT($A$2:$A, A2)).

How do I count duplicate rows across several columns?

Use COUNTIFS with one range and criterion per column, for example =COUNTIFS($A$2:$A, A2, $B$2:$B, B2) in a helper column. A running version, =COUNTIFS($A$2:A2, A2, $B$2:B2, B2), returns 2 or more on every extra copy, so =COUNTIF(C2:C, ">1") counts the rows a dedupe would remove.

How do I count values that appear only once?

=IFERROR(ROWS(UNIQUE(ARRAYFORMULA(LOWER(FILTER(A2:A, A2:A<>""))), FALSE, TRUE)), 0). The third UNIQUE argument, exactly_once, keeps only entries with no duplicates.

Counted them and want them gone? SheetDupes (disclosure: we make it) is a Google Sheets add-on that finds, highlights and removes duplicates from a sidebar. Pick the columns that define a duplicate, preview the matching groups with their counts, highlight the extra rows without changing any values, and only then remove or merge them. It copies a backup tab before it removes or merges anything, ignores extra spaces and, optionally, letter case and punctuation. Preview and Highlight are free on any size sheet; there is a 14-day free trial with no credit card, and writes remain free after the trial on sheets with up to 2,000 data rows during launch (through Jan 31, 2027; 500 after that). It only reads and writes the spreadsheet you have open, and your data is not sent to Loomwise. It is live on the Google Workspace Marketplace.
Install free from Google Workspace MarketplaceSee SheetDupes
Want to test it first? Try it on sample data (makes a copy of a 12-row example sheet in your Drive).

Related guides

Menu steps follow Google’s Docs Editors Help pages on removing duplicates and trimming whitespace, Column stats and pivot tables; function behavior is from the help pages for COUNTIF, COUNTIFS, COUNTUNIQUE, UNIQUE and QUERY. Instructions refer to Google Sheets as it worked on November 18, 2026; menu names can change. Google Sheets is a trademark of Google LLC and this site is not affiliated with Google. Questions or corrections: hello@loomwise.app.