Check for Duplicates in Google Sheets
en
Run read-only duplicate check

Duplicate detection, grouping, and report export

Custom Formula To Find Duplicates In Google Sheets

Use a read-only duplicate check for custom 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.

Inspect duplicate groups in the selected sheet dataKeep source values unchanged during the checkExport row-level evidence for the next step
Run read-only duplicate check
Review grouped matches for custom formula to find duplicates in google sheets before exporting duplicate evidence.

Report reading guide

Read duplicate results in three passes

  1. Scope: confirm selected key columns.
  2. Groups: review repeated values and counts.
  3. Rows: compare source row numbers before acting.
Key customer@example.comCount 3 matchesRows 12, 27, 41

Use COUNTIF as a custom formula to find duplicates in Google Sheets without deleting source values. For values in A2:A1000, apply the following formula as a conditional formatting rule to highlight every nonblank value that occurs more than once:

The embedded duplicate checker validates your data without altering the source sheet.
=AND($A2<>"",COUNTIF($A$2:$A$1000,$A2)>1)

The fixed range reference checks the same data set for each row, while $A2 changes with the row being formatted. For literal text containing * or ?, use the SUMPRODUCT alternative below: COUNTIF treats those characters as wildcards in criteria.

Highlight duplicate values

  1. Select A2:A1000, excluding the header.
  2. Choose Format > Conditional formatting.
  3. Under Format cells if, select Custom formula is.
  4. Enter the formula above, choose a formatting style, and select Done.
  5. Check a repeated value and confirm that every occurrence is highlighted.

For example, if A2 and A5 both contain K17, both cells are highlighted. The formula returns TRUE when the current cell is not blank and its count in the selected range exceeds one. It does not move, edit, or remove records.

Use the first row of the formatting range in the formula's cell reference. If the range starts at A5, use $A5, not $A2. Extend the fixed count range and the applied range together when your data grows; otherwise, later records may be omitted.

Mark only later occurrences

Use an expanding range when the first occurrence should remain unmarked:

=AND($A2<>"",COUNTIF($A$2:$A2,$A2)>1)

Apply it to A2:A1000. The first K17 has a count of one in the range ending at its row; the second has a count of two and is highlighted. This rule depends on row order: sorting can change which occurrence appears first.

Highlight the whole record

Select A2:D1000 and use the first formula under Custom formula is. The locked column in $A2 checks column A for each row while the style applies across columns A through D. This helps inspect other fields before deciding whether matching keys represent unwanted duplicate rows. how-to-find-non-duplicates-in-google-sheets

Build a duplicate report with formulas

A helper column makes the result visible as text and can be filtered. Enter this formula in B2, provided column B is available, and fill it down through B1000:

=IF(A2="","",IF(COUNTIF($A$2:$A$1000,A2)>1,"Duplicate","Unique"))

The label Duplicate appears on every occurrence of a repeated value. Unique means the value occurs once within the specified range, not necessarily once in the entire spreadsheet. Keep the range fixed while filling down so that each row is compared against the same scope.

For a literal comparison that does not interpret wildcard characters in the current value, use:

=IF(A2="","",IF(SUMPRODUCT(--($A$2:$A$1000=A2))>1,"Duplicate","Unique"))

This formula compares each cell directly with A2. It is useful for values such as A*1, which can produce unintended matches when passed as a COUNTIF criterion. Keep the range reasonably bounded because evaluating a large range for every row can slow a sheet.

Normalize the selected values

Extra spaces and inconsistent capitalization can obscure matches. If column B is free, place this formula in B2 and fill it down:

=IF(A2="","",LOWER(TRIM(A2)))

Run the duplicate formula against B2:B1000 to compare normalized keys while keeping column A unchanged. For example, Blue and blue become the same key. Normalization changes the comparison, not the original value; confirm that case and surrounding spaces are not meaningful identifiers before relying on the result. find-duplicates-google-sheets-formula

TRIM does not remove non-breaking spaces, and normalization does not resolve every difference in punctuation or spelling. Review unexpected results against the original cells rather than assuming all similar-looking text is identical.

Group and count matches

To produce one row per repeated key, place this formula in an empty area or on a separate report sheet:

=QUERY(A2:A1000,"select A, count(A) where A is not null group by A having count(A) > 1 label count(A) 'Count'",0)

The output lists each repeated value with its group count. For normalized comparison, substitute the helper range B2:B1000; the displayed key will then be normalized rather than the original spelling. QUERY can treat minority data types in a mixed-type column as null, so check the source and output when numbers and text are mixed.

For a key consisting of two fields, use COUNTIFS instead of combining values into a single string. With customer IDs in column A and dates in column B, enter this in an empty column and fill down:

=IF(OR(A2="",B2=""),"",IF(COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2)>1,"Duplicate pair","Unique pair"))

A repeated customer ID alone does not qualify: both fields must match. This example excludes rows with either key field blank. COUNTIFS also interprets wildcard characters in text criteria, so use a direct-comparison method if those characters must be literal.

Inspect the report

Compare the group count with the underlying rows before acting. Filter the helper column for Duplicate, then inspect the key and surrounding fields. A repeated invoice number, for example, may indicate an accidental copy or legitimate line items; the key alone cannot decide which record to retain. google-sheets-find-duplicates-formula

To list current sheet row numbers for a specific key entered in E2, use:

=IF(E2="","",IFNA(FILTER(ROW(A2:A1000),A2:A1000=E2),"No matches"))

The result spills one row number per match. Leave space beneath the formula, and remember that these are current row positions: sorting or inserting rows can change them. If E2 holds a normalized key, compare it against the normalized helper range instead.

The embedded duplicate checker can also check pasted data and provide downloadable evidence without changing the source sheet. Review its selected column scope and results against the spreadsheet before using the report for a cleanup decision.

Export evidence

Keep the original data and a separate report before changing records. Copy the group counts and relevant row-level results into a report sheet; use Paste special > Values only if the exported evidence should remain fixed rather than recalculate. Include the key fields, current row numbers, and enough context to identify records without exposing unnecessary data.

Download the report sheet using File > Download and a suitable format such as CSV, or retain a spreadsheet copy when formulas and formatting are needed. A CSV export contains values from the current sheet, not a complete multi-sheet workbook. Recheck row references against the source if the data has changed since the report was created.

Avoid common formula mistakes

  • Including the header: Start at row 2 when row 1 contains labels, or the header can enter the counts.
  • Mismatched ranges: Set the conditional formatting range and formula references to cover the intended rows. A relative reference must point to the first row of the applied range.
  • Counting blanks: Use an explicit nonblank test unless empty cells are meaningful duplicate keys.
  • Confusing keys with rows: A duplicated value in one column does not prove that every field in those records is identical.
  • Ignoring criteria and locale: COUNTIF and COUNTIFS interpret wildcards. Some spreadsheet locales also require semicolons instead of commas as formula argument separators.

Duplicate formulas provide evidence, not a deletion decision. Validate the matching rule and preserve the report before making any changes to the source.

FAQ

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

Run read-only duplicate check