How to Highlight Duplicates in Google Sheets: Conditional Formatting Formulas for One Column, Whole Rows, Repeats Only and Two Sheets (2026)

Coloring duplicates is the safe first step before you delete anything: you can see every repeat in place, check whether it is a real duplicate, and decide what to do with it. Google Sheets has no one-click “highlight duplicates” rule, but a custom formula in conditional formatting does the job in under a minute. This guide gives the formula for each common case and explains the two mistakes that make the wrong cells light up.

The basic rule: highlight duplicates in one column

  1. Select the column, for example click the A column header (or select A1:A).
  2. Choose Format › Conditional formatting.
  3. Under Format rules, open Format cells if… and choose Custom formula is.
  4. Enter the formula below, pick a fill color under Formatting style, and click Done.
=COUNTIF($A:$A,$A1)>1

Conditional formatting evaluates the formula once for every cell in the range, as if you had written it in the top-left cell and filled it down. COUNTIF($A:$A,$A1) counts how many cells in column A hold the same value as the current cell; anything above 1 is a duplicate, so every copy, including the first, is colored. The $ before A locks the column; the 1 without a $ lets the row move as the rule walks down the column.

Ignore blank cells. On a column with gaps, empty cells can be treated as duplicates of each other. Add a not-blank check to be safe:

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

Have a header row? Apply the rule to A2:A and write the formula for row 2: =AND($A2<>"",COUNTIF($A$2:$A,$A2)>1). Why the row number must change is covered under pitfalls below.

Highlight the whole row when several columns repeat

Often a duplicate is a combination: the same first name and last name, or the same email and date. To color the entire row, apply the rule to the whole table (for example A2:D) and use COUNTIFS with one range/criterion pair per key column:

=AND($A2<>"",COUNTIFS($A$2:$A,$A2,$B$2:$B,$B2)>1)

Every column reference has a $ in front of the letter. That is what makes the whole row light up: cells in columns C and D still check columns A and B of their own row. Without the $, the rule in column C would compare columns C and D instead.

Helper-column alternative. With many key columns, or if you also want to filter on the result, build a key in a spare column. In E2:

=A2&"|"&B2&"|"&C2

Fill it down, then apply the rule to A2:E with =AND($A2<>"",COUNTIF($E$2:$E,$E2)>1). Keep the separator: without it, ab + c and a + bc both become abc and count as a match. The blank check is on $A2, not the key, because an empty row still produces a key of ||, and all empty rows would match each other.

Highlight only the second and later copies

To leave the first occurrence plain and color only the repeats, so the color marks exactly the rows you would delete, use a range that starts at a fixed first row and ends at the current row:

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

On row 5, the range is $A$1:$A5: only the rows above plus the current one. The first copy counts 1 and stays plain; the second copy counts 2 and is colored. For whole rows, use the same pattern in COUNTIFS: =AND($A2<>"",COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2)>1) applied to A2:D. Which copy counts as “first” depends on the current sort order, so sort first if, for example, you want to keep the newest row.

Case-sensitive duplicates

COUNTIF and COUNTIFS ignore letter case, so Anna and ANNA are a match. Usually that is what you want. When case matters, for example product codes where ab12 and AB12 are different items, compare with EXACT inside SUMPRODUCT:

=AND($A1<>"",SUMPRODUCT(--EXACT($A$1:$A,$A1))>1)

EXACT returns TRUE only for an identical match, including case; -- turns TRUE/FALSE into 1/0 and SUMPRODUCT adds them up. For second-and-later copies only, shrink the range the same way: =AND($A1<>"",SUMPRODUCT(--EXACT($A$1:$A1,$A1))>1). The opposite problem, values that should match but don’t because of extra spaces or formatting, is covered in duplicates that don’t match exactly.

Highlight duplicates across two sheets

A conditional formatting formula can only refer to its own tab directly; Google’s help says to use INDIRECT to reference another sheet, because it takes the reference as text. To color values on the current tab that also appear in column A of a tab named Sheet2:

=AND($A1<>"",COUNTIF(INDIRECT("Sheet2!A:A"),$A1)>0)

Note the >0: one match on the other tab is enough. If the tab name has spaces, wrap it in single quotes inside the text: INDIRECT("'Client list'!A:A"). Because the reference is text, renaming the tab breaks the rule silently, so update the formula if you rename. To check the other direction, add the mirror rule on the second tab. For values in a different spreadsheet file, conditional formatting cannot reach it at all; bring the column in with IMPORTRANGE on a helper tab first. Comparing two columns or two sheets covers that in more detail.

Common pitfalls (why the wrong cells light up)

How to remove the highlight

Select a cell in the range, choose Format › Conditional formatting, hover over the rule in the sidebar and click the trash icon. The colors disappear and no values are changed. To keep the rule but stop it covering some cells, edit Apply to range instead. Deleting the duplicate rows themselves is a separate step: see how to find and remove duplicates, which covers Data › Data cleanup › Remove duplicates and keeping the right row.

FAQ

Does Google Sheets have a built-in highlight duplicates option?

No. Conditional formatting has no preset rule for duplicates, so you choose Custom formula is and enter a COUNTIF formula such as =COUNTIF($A:$A,$A1)>1.

Why are the wrong cells highlighted?

The row number in the formula must match the first row of the Apply to range. If the range starts at A2, write the formula for row 2 ($A2), not row 1. Also lock the column with $ and lock the start of the counted range ($A$2).

How do I highlight only the second and later copies?

Use a range that grows down the column: =COUNTIF($A$1:$A1,$A1)>1. The first copy counts 1 and stays plain; every later copy counts 2 or more and is highlighted.

Is COUNTIF case-sensitive?

No. COUNTIF treats Anna and ANNA as the same. For a case-sensitive rule use =AND($A1<>"",SUMPRODUCT(--EXACT($A$1:$A,$A1))>1).

How do I highlight duplicates between two sheets?

Conditional formatting cannot refer to another sheet directly, so wrap the reference in INDIRECT: =AND($A1<>"",COUNTIF(INDIRECT("Sheet2!A:A"),$A1)>0). Put the sheet name in single quotes inside the text if it contains spaces.

How do I remove the highlighting?

Open Format › Conditional formatting, hover over the rule and click the trash icon. The highlight goes away; your data is not changed.

Rather not maintain formulas? 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, 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

Instructions refer to Google Sheets as it worked on November 17, 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.