Duplicate detection, grouping, and report export
Find Duplicates Between 2 Columns In Google Sheets
Use a read-only duplicate check for find duplicates between 2 columns 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 duplicates between 2 columns in Google Sheets, use COUNTIF to test each nonblank value in the first column against the second. Add a helper column to label matches, or use conditional formatting to highlight them without changing the source values.
Compare two columns with a helper formula
Assume column A contains the first list and column B contains the second, with headers in row 1 and data in rows 2–100. In C2, enter:
=IF(A2="","",IF(COUNTIF($B$2:$B$100,A2)>0,"Match","Not found"))
Fill the formula down through C100. Each nonblank value in A is labeled Match if it appears anywhere in B, regardless of row position. The dollar signs keep the search range fixed as you copy the formula.
For example, if A2 is pear and B7 is pear, C2 returns Match. If pear occurs three times in column A and once in column B, all three A rows are labeled; the formula does not pair occurrences one to one.
To check the other direction, enter this formula in D2 and fill down:
=IF(B2="","",IF(COUNTIF($A$2:$A$100,B2)>0,"Match","Not found"))
The second check identifies values in B that are missing from A. This matters when the lists have different lengths or when you need evidence for both sides. Adjust each range to cover the actual data set, including the last populated row.
Count occurrences in the other column
Replace the label with a count when you need to distinguish a single match from multiple occurrences. In C2, use:
=IF(A2="","",COUNTIF($B$2:$B$100,A2))
A result of 0 means the value was not found in B; 2 means it appeared twice there. Filter C for counts greater than zero to inspect matching rows, or filter for zero to find missing values. Leave the header outside the data range so it is not counted as a record.
COUNTIF is case-insensitive and interprets * and ? in its criterion as wildcards. For identifiers containing those characters, escape them before counting literal matches:
=IF(A2="","",COUNTIF($B$2:$B$100,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"~","~~"),"*","~*"),"?","~?")))
Highlight duplicate values across columns
Conditional formatting makes matches visible in the original data range without adding labels. To highlight values in A that also occur in B: google-sheets-find-duplicates-in-2-columns
- Select
A2:A100. - Open Format > Conditional formatting.
- Under Format cells if, choose Custom formula is.
- Enter the formula below, choose a format, and select Done.
=AND(A2<>"",COUNTIF($B$2:$B$100,A2)>0)
Add a separate rule for B2:B100 if both columns should be highlighted:
=AND(B2<>"",COUNTIF($A$2:$A$100,B2)>0)
Each rule uses a relative reference to the first cell in its selected range and an absolute reference to the opposite range. Change A2 or B2 if the selection starts on a different row. These rules have the same case and wildcard behavior as the basic COUNTIF formula; use the escaped criterion for literal wildcard characters.
Highlighting shows membership, not a count or a matching row number. If the intended comparison is between cells on the same row, use =AND(A2<>"",A2=B2) instead. A value appearing elsewhere in B will not qualify unless it also matches B on that row.
Prepare values before comparing
Normalize the selected values
Extra spaces and inconsistent capitalization can hide matches. If those differences are irrelevant to your identifiers, create normalized helper columns rather than overwriting the source. For text in A2, use: how-to-find-duplicates-in-a-column-in-google-sheets
=LOWER(TRIM(SUBSTITUTE(A2,CHAR(160)," ")))
Fill down, create the equivalent helper for B, then compare the two helper ranges with the earlier formulas. SUBSTITUTE replaces nonbreaking spaces, TRIM removes leading and trailing spaces and reduces repeated ordinary spaces, and LOWER standardizes case. Test the transformation first: removing repeated spaces may merge values that should remain distinct.
Keep original values beside normalized values for review. Numbers stored as text, dates, punctuation, spelling differences, and other hidden characters can still produce unexpected results. A formatted value that looks identical to another cell may have a different underlying value or type; inspect the source before treating it as a duplicate.
Group and count matches
To build a distinct list of nonblank A values that occur in B, place this formula in an empty area:
=IFNA(UNIQUE(FILTER(A2:A100,A2:A100<>"",COUNTIF(B2:B100,A2:A100)>0)),"No matches")
For each returned value, use the count formula below in the next column and fill it down. Replace E2 with the first cell of the returned list:
=IF(E2="","",COUNTIF($A$2:$A$100,E2))
Use an equivalent formula referencing B to show its count on the other side. The resulting group counts describe occurrences in each list, not a count of unique row pairs. These formulas use COUNTIF matching rules; escape wildcard characters if the keys contain them. find-duplicates-in-column-google-sheets
Inspect the duplicate report
Review the matched values against the original rows before deciding what to change. A match across columns does not by itself prove that either record is redundant: two customers may share a name, while a repeated order ID may require investigation.
To return row numbers from B for a value in A2, use:
=IF(A2="","",IFNA(TEXTJOIN(", ",TRUE,FILTER(ROW($B$2:$B$100),$B$2:$B$100=A2)),"Not found"))
This returns sheet row numbers, such as 4, 12, rather than positions relative to the selected range. Check the referenced sheet and range when using the evidence. Direct equality here treats * and ? as literal characters, unlike an unescaped COUNTIF criterion.
For values on another sheet, replace the relevant range with a sheet reference such as 'Other sheet'!$B$2:$B$100. Row numbers then refer to that other sheet. Keep range boundaries aligned when combining values and ROW in FILTER. google-sheets-check-for-duplicates-3-cells
The embedded duplicate checker can inspect pasted data within a selected column scope and return a read-only report with grouped counts and row indexes. Its report is evidence for review, not an instruction to delete records.
Export evidence without changing the source
Keep the original spreadsheet intact while preparing a report. Create a separate sheet, copy the relevant identifiers, match labels, counts, and row references, then use Paste special > Values only if the report should remain fixed when source data changes. Include column headers and enough context to identify the source sheet and range.
After reviewing the copied report, use File > Download to export it in a suitable format. CSV exports only the current sheet, so select the report sheet first; a spreadsheet export can retain multiple sheets. The embedded checker also supports downloading its report.
Avoid sorting a single column independently when rows contain related fields: that can separate identifiers from their records. Select the full table before using Data > Sort range, and preserve source row references in the report before sorting. For approximate matches such as spelling variants, exact formulas are a starting point only; inspect candidates manually before merging or removing anything.
FAQ
Does this page delete find duplicates between 2 columns 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