Highlighting duplicates means applying a colour to cells whose values appear more than once in a selected range, so repeated entries stand out visually. This is useful for cleaning mailing lists, checking invoice numbers, or spotting repeated survey responses. The exact steps differ slightly between Excel and Google Sheets, but both use conditional formatting and both can be done in under a minute once you know where to click. You will need a spreadsheet program (Excel 2016 or later, or Google Sheets) and a column or range of data that you want to check. No add-ins or macros are required.
What You'll Need
- A computer with Excel (Microsoft 365, 2019, 2016) or a free Google account for Google Sheets.
- Your data already entered into a single column or a rectangular range. Avoid blank rows inside the range, as they can break the rule.
- Optional: a second colour if you also want to highlight unique values at the same time.
Step-by-Step
- Select the range you want to check. Click the first cell and drag to the last, or press Ctrl+Shift+End (Windows) or Cmd+Shift+End (Mac) to select to the end of the data. If you select only part of a column, duplicates outside the selection will not be flagged. For a whole column, click the column letter, but be aware this includes the header and thousands of empty cells below your data; it is usually better to select just the used rows.
- Open Conditional Formatting. In Excel, go to Home > Conditional Formatting. In Google Sheets, go to Format > Conditional formatting. A side panel or dialog box opens.
- Choose the duplicate rule. In Excel, click Highlight Cells Rules > Duplicate Values. In Google Sheets, under the “Format cells if” dropdown, choose “Custom formula is” and enter a formula (see step 4). Excel users can skip to step 5.
- Enter the formula for Google Sheets. With your range selected (for example A2:A100), type
=COUNTIF($A$2:$A$100,A2)>1into the formula box. The dollar signs lock the range so each cell is compared against the whole list. If your range is A2:C100, use=COUNTIF($A$2:$C$100,A2)>1to check for duplicates across all columns. Adjust the range to match your selection exactly. - Pick a highlight colour. In Excel, the Duplicate Values dialog offers a preset red fill with dark red text; you can change it via the second dropdown. In Google Sheets, click the fill colour icon in the formatting panel and choose a colour.
- Apply the rule. Click OK in Excel or Done in Google Sheets. Duplicates are now highlighted instantly. The rule updates automatically if you change a value, so a cell that becomes unique loses its colour.
- Check the result. Scroll through your data. If nothing is highlighted, the most common cause is a range mismatch (see Troubleshooting). If everything is highlighted, you likely selected only one column but the formula refers to a different range.
- Remove the highlighting when done. In Excel, go to Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells. In Google Sheets, open the conditional formatting panel, click the rule, and press the trash icon.
Common Mistakes
- Selecting the wrong range. If you select A2:A50 but your data runs to A100, duplicates in rows 51–100 are ignored. Always match the selection to the data.
- Including the header row. The word “Name” or “Email” in row 1 will be treated as a value. If it appears only once, it will not be highlighted, but if you have two header-like rows, both may light up. Start the selection at row 2.
- Using relative references in Google Sheets. Writing
=COUNTIF(A2:A100,A2)>1without dollar signs causes the range to shift down for each row, so later rows compare against the wrong block. Use absolute references ($A$2:$A$100). - Expecting case-sensitive matching. Both Excel and Google Sheets treat “Apple” and “apple” as duplicates by default. If case matters, you need a helper column with the EXACT function, not conditional formatting alone.
- Forgetting about spaces. “John ” (trailing space) and “John” are different values to the rule. Use TRIM in a helper column first if your data came from copy-paste.
Tips
- To highlight duplicates across multiple columns (for example, a name in column A and the same name in column C), select the whole block A2:C100 and use the COUNTIF formula with the full range. Excel’s built-in Duplicate Values rule only compares each cell to the entire selection, so it works across columns too.
- Use a light fill colour such as pale yellow or light green so the text remains readable. Dark red fills can obscure the value you are trying to inspect.
- If you want to keep the highlights permanently, copy the range and use Paste Special > Values into a new sheet, then apply the formatting there. Conditional formatting is dynamic and will disappear if you delete the rule.
- For a quick count of how many duplicates exist, use
=COUNTIF(A:A,A2)in a helper column and filter for values greater than 1. This gives you the number of occurrences, not just a colour. - In Excel, you can sort by cell colour after highlighting (Data > Sort > Sort by > Cell Color) to bring all duplicates together for review.
Troubleshooting
- Nothing is highlighted. Check that the range in the rule matches the selected cells exactly. In Google Sheets, confirm the formula uses absolute references and that the range starts at the same row as your selection. In Excel, make sure you chose “Duplicate” and not “Unique” in the dropdown.
- Everything is highlighted. This usually means the formula is comparing each cell to itself only, or the range is a single cell. Widen the range. In Google Sheets, a common error is writing
=COUNTIF(A2,A2)>1, which always returns false; the first argument must be the full list. - Only some duplicates are highlighted. Likely cause: the selection includes blank rows that break the range, or the data contains leading/trailing spaces. Clean the data with TRIM and remove blank rows, then reapply.
- The rule disappeared after reopening the file. Conditional formatting is saved with the file, but if you pasted data from another workbook, the rule may have been overwritten. Reapply the rule to the new range.
- Numbers stored as text are not matching. A number formatted as text (often left-aligned) will not match a true number. Use VALUE or Text to Columns to convert, then reapply the rule.
Frequently Asked Questions
Can I highlight duplicates in more than one column at once?
Yes. Select the entire block (for example A2:C100) and apply the rule. Excel’s Duplicate Values rule compares each cell to the whole selection, so a value that appears in column A and again in column C will be highlighted. In Google Sheets, use a COUNTIF formula that covers the full block.
Does highlighting duplicates delete them?
No. Conditional formatting only changes appearance. To remove duplicates, use Data > Remove Duplicates in Excel or Data > Data cleanup > Remove duplicates in Google Sheets. Always work on a copy first, because removal is permanent.
Why are “Apple” and “apple” not highlighted as duplicates?
Both Excel and Google Sheets treat text as case-insensitive by default in conditional formatting, so they should be highlighted. If they are not, check for extra spaces or non-printing characters. Use the TRIM and CLEAN functions in a helper column to standardise the text.
Can I highlight duplicates based on two columns together?
Yes, but it requires a helper column. In a new column, enter =A2&"|"&B2 to combine the two values, then apply the duplicate rule to that helper column. This flags rows where the combination of both columns repeats.
Is there a limit to how many cells I can format?
Excel allows conditional formatting across a very large range, but performance slows if you apply it to entire columns with hundreds of thousands of rows. Limit the range to your actual data. Google Sheets has a similar practical limit; formatting more than about 10,000 cells can make the sheet sluggish.
Can I highlight duplicates in Google Sheets on my phone?
The mobile app does not support creating conditional formatting rules. You can view existing highlights, but to add or edit a rule you need the desktop browser version of Google Sheets.