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: Email | B: Event | |
|---|---|---|
| 2 | ana@x.com | Gala |
| 3 | bo@x.com | Gala |
| 4 | Ana@x.com | Gala |
| 5 | cy@x.com | Picnic |
| 6 | bo@x.com | Picnic |
| 7 | ana@x.com | Picnic |
| 8 | dee@x.com | Gala |
Treating Ana@x.com as the same person as ana@x.com, the four numbers for column A are:
| Question | Answer | Why |
|---|---|---|
| How often does each email appear? | ana 3, bo 2, cy 1, dee 1 | Count per value |
| How many extra copies are there? | 3 | 7 rows minus 4 distinct emails; what a dedupe removes |
| How many rows are part of a duplicate group? | 5 | 3 ana rows + 2 bo rows |
| How many emails repeat? | 2 | ana 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: Email | F: Count |
|---|---|
| ana@x.com | 3 |
| bo@x.com | 2 |
| cy@x.com | 1 |
| dee@x.com | 1 |
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:
| Number | Formula | Example |
|---|---|---|
| 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:
| Tool | Ana@x.com vs ana@x.com |
|---|---|
COUNTIF, COUNTIFS, SUMPRODUCT with = | Same value |
| Data › Data cleanup › Remove duplicates | Same value (Google’s help: cells that differ only in letter case, formatting or formulas count as duplicates) |
| COUNTUNIQUE, UNIQUE, QUERY group by | Different 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
- Blanks counted as duplicates.
COUNTIF(A2:A, A2:A)over an open-ended range also counts the empty cells below your data. Keep theA2:A<>""guard or use FILTER, as in the formulas above. - Wildcards in values. COUNTIF and COUNTIFS treat
*,?and~in the criterion as wildcards, so a SKU likeAB*1can match other codes. Use the EXACT orSUMPRODUCT(--(LOWER($A$2:$A)=LOWER(A2)))form for codes that contain them. - Numbers stored as text.
00123typed as text and123as a number can be counted differently by different functions. Format ID columns as Format › Number › Plain text before entering codes. - Header inside the range. Start ranges at row 2, or the header is counted as a value; with QUERY, set the header argument to 1.
- Very large sheets. A per-row COUNTIF over a whole column, filled down tens of thousands of rows, gets slow. The single QUERY table is much lighter.
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.
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
- How to Find and Remove Duplicates in Google Sheets: Highlight, Count, Delete and Keep the Original (2026)
- How to Highlight Duplicates in Google Sheets: Conditional Formatting Formulas for One Column, Whole Rows, Repeats Only and Two Sheets (2026)
- How to Compare Two Columns or Two Sheets in Google Sheets to Find Matches and Duplicates (2026)
- Duplicates That Don’t Match Exactly in Google Sheets: Case, Extra Spaces, Gmail Dots, Phone Formats and Typos (2026)
- How to Remove Duplicates in Google Sheets but Keep the Latest, First or Highest Row per Key (2026)
- How to Prevent Duplicate Entries in Google Sheets: Data Validation Rules, Warnings and a Small Script (2026)
- How to Combine Two Lists or Several Tabs in Google Sheets Without Duplicates: VSTACK, UNIQUE, One Row per Key and Other Files (2026)
- How to Merge Duplicate Rows in Google Sheets: Sum the Numbers, Join the Notes and Fill the Blanks (2026)
- UNIQUE vs Remove Duplicates in Google Sheets: Live or Static, Letter Case, Spaces, Columns and Headers (2026)
- How to Remove Duplicates Within a Cell in Google Sheets: Comma-Separated Lists, Tags, Line Breaks and Letter Case (2026)
- How to Show Only the Duplicates in Google Sheets: Filter Duplicate Rows, List Repeated Values and Find Rows That Appear Once (2026)
- How to Find Duplicates Across Multiple Columns in Google Sheets: Rows That Match on Two or More Columns, and Values Repeated Anywhere in a Range (2026)
- How to Remove Duplicates Automatically in Google Sheets: Apps Script on a Daily Timer, on Form Submit or From a Menu (2026)
- How to Find Duplicates in Google Sheets but Ignore Blank Cells: Highlight, Count, List and Remove Without Empty Rows Getting in the Way (2026)
- How to Find Duplicate Transactions in Google Sheets: Double-Imported Rows, Invoices Paid Twice and Same-Amount Charges Within a Few Days (2026)
- How to Format Phone Numbers in Google Sheets: Strip Dashes and Spaces, Show (555) 010-1234, Handle +1 and Extensions, Then Find Duplicate Contacts (2026)
- How to Change Text Case in Google Sheets: UPPERCASE, lowercase, Proper Case Names, Sentence Case and Duplicates That Differ Only in Case (2026)
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.