Duplicate detection, grouping, and report export
What Is The Formula To Find Duplicates In Google Sheets
Use a read-only duplicate check for what is the formula to find duplicates in google sheets when you need to inspect repeated values without changing the source sheet. Paste the relevant data, select the key scope, review grouped counts and row indexes, and export the evidence.
Report reading guide
Read duplicate results in three passes
- Scope: confirm selected key columns.
- Groups: review repeated values and counts.
- Rows: compare source row numbers before acting.
To find duplicate values in Google Sheets, enter =IF(A2="","",COUNTIF($A$2:$A$1000,A2)>1) beside your data and copy it down. The formula returns TRUE for every nonblank value that appears more than once in A2:A1000, including its first occurrence. It leaves the source values unchanged.
Find duplicates in one column
Suppose column A contains email addresses, with a header in A1. To check each address:
- Select an empty cell in row 2, such as B2.
- Enter the formula below.
- Copy B2 down to the last row you want to check.
- Filter column B for
TRUEto inspect matching rows.
=IF(A2="","",COUNTIF($A$2:$A$1000,A2)>1)
COUNTIF counts occurrences of the value in A2 within the fixed range. The dollar signs keep that range reference unchanged as you copy the formula, while the relative reference A2 advances to A3, A4, and so on. Adjust 1000 to cover your data set; rows outside the range are not counted.
For example, if A2 and A5 both contain alex@example.com, both rows return TRUE. A value that occurs once returns FALSE. The blank check prevents empty cells from being reported as duplicates.
Mark only repeated occurrences
To keep the first occurrence unmarked and flag later ones, use an expanding range:
=IF(A2="","",COUNTIF($A$2:A2,A2)>1)
When copied down, the range starts at A2 but ends at the current row. The first occurrence returns FALSE; the second and subsequent occurrences return TRUE. Sorting the data changes which occurrence is first, so preserve the original order if that distinction matters.
Normalize the selected values
Values that look alike can differ because of spaces or inconsistent capitalization. To compare a normalized version without overwriting the original, enter this in an empty helper column and copy it down:
=IF(A2="","",LOWER(TRIM(A2)))
Use the helper column as the input range for COUNTIF. LOWER standardizes letter case, and TRIM removes leading, trailing, and repeated ordinary spaces. These changes can merge values that should remain distinct, so choose normalization rules that fit the data. TRIM does not remove every kind of whitespace; inspect unusual characters separately.
Group and count matches
A row-by-row flag shows where duplicates occur. A grouped report shows each repeated value and its count. With values in A2:A1000, place this formula in a clear area with room for two output columns:
=QUERY(A2:A1000,"select A, count(A) where A is not null group by A having count(A) > 1 label A 'Value', count(A) 'Count'",0)
The result lists values occurring more than once and the number of rows in each group. For instance, three entries for the same address produce one report row with a count of 3. If you normalized values in a helper column, point QUERY at that column to group by the normalized result instead.
The grouped report does not identify source rows by itself. Use the row-level flags alongside it to inspect each record before making changes. If the input range contains mixed data types, QUERY can treat minority types as null; check numeric values and text-formatted numbers separately when that distinction matters.
Find duplicates across multiple sheets
To flag values in Sheet1 that also occur in Sheet2, enter this in an empty cell on Sheet1 and copy it down:
=IF(A2="","",COUNTIF(Sheet2!$A$2:$A$1000,A2)>0)
This formula checks whether the Sheet1 value appears at least once in the Sheet2 range. It does not count duplicates within Sheet1 or flag rows on Sheet2. Repeat the check in the opposite direction if you need flags on both sheets. If a sheet name contains spaces, use a reference such as 'Sheet 2'!$A$2:$A$1000.
To find repeated values anywhere in two ranges, stack them in an empty report area, then apply the grouping formula to the stacked column:
={Sheet1!A2:A1000;Sheet2!A2:A1000}
A grouped count above 1 can represent two records from one sheet, one from each sheet, or a combination. Use the cross-sheet COUNTIF check when you specifically need values present on both sheets. Keep sheet names and source row numbers alongside copied data if you need to trace each result back to its origin.
For separate spreadsheet files, the sheet reference alone is insufficient. Bring the required data into one spreadsheet using an authorized import, then compare the imported range. Access permissions and refresh behavior can affect what the comparison sees.
Inspect the duplicate report
Check the scope before interpreting any count. A duplicate in a single key column is not necessarily a duplicate row: two customers may share a name but have different IDs. Conversely, identical records can be missed if the chosen range excludes part of the data.
Review these details for each group:
- Key: Confirm that the selected value or normalized value represents the identity you want to compare.
- Count: Verify whether the report includes all occurrences or only later ones.
- Source rows: Inspect surrounding fields to distinguish legitimate repeats from errors.
- Range: Include all relevant rows and exclude headers from data checks.
- Formula result: Check for errors, unexpected blanks, or values stored as text instead of numbers.
For a two-column key, use COUNTIFS rather than assuming either column alone identifies a record. This example flags rows where the combination of A and B occurs more than once, while excluding rows with either key cell blank:
=IF(OR(A2="",B2=""),"",COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2)>1)
Copy the formula down and keep both criteria ranges the same size. A shared name with a different ID will not be flagged by this combination. Decide separately whether incomplete keys should be reviewed as missing data.
Export evidence
Keep the original spreadsheet intact while reviewing results. Filter the row-level flag for TRUE, copy the relevant records and identifiers to a separate report sheet, and include the key, count or status, and source location. Check that the copied rows correspond to the scope you tested before sharing the report.
Download the report sheet through File > Download in a suitable format, such as CSV, and verify the exported file. CSV represents one sheet and does not retain spreadsheet formulas or formatting as live spreadsheet features; keep the original workbook if reviewers need those details.
The embedded duplicate checker also accepts pasted CSV or TSV data and produces a read-only check with downloadable evidence. Select the relevant columns and review its grouped results and row indexes against the source before using them for a separate cleanup decision.
FAQ
Does this page delete what is the formula to find duplicates in google sheets?
No, it returns a read-only duplicate report.
Run read-only duplicate check to inspect duplicate detection, grouping, and report export and export a controlled report without destructive cleanup.
Run read-only duplicate check to inspect duplicate detection, grouping, and report export and export a controlled report without destructive cleanup.
Run read-only duplicate check