Highlight Duplicate Values – Excel & Google Sheets
Written by
Reviewed by
Last updated on August 2, 2023
This tutorial will demonstrate how to highlight cells in a range of cells where there are duplicate values using Conditional Formatting in Excel and Google Sheets.
Conditional Formatting – Highlight Duplicate Values
Duplicate Cell Rule
To highlight cells with duplicate values, use the built-in duplicate value rule within the Conditional Formatting menu option. (You can also highlight the whole row.)
- Select the range you want to apply formatting to.
- In the Ribbon, select Home > Conditional Formatting > Duplicate Values.
- Select the format you require.
- Click OK to see the result.
Create a New Rule
You can highlight cells where there are duplicate values in a range of cells by creating a New Rule in Conditional Formatting.
- Select the range you want to apply formatting to.
- In the Ribbon, select Home > Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format, and enter the COUNTIF formula:
=COUNTIF($B$4:$E$11,B4)>$G$10
- Click on the Format button and select your desired formatting.
- Click OK, and then OK once again to return to the Conditional Formatting Rules Manager.
- Click Apply to apply the formatting to your selected range and then click Close. The result will show you how many numbers appear more than four times in your range.
Highlight Duplicate Values in Google Sheets
Use a custom function to highlight duplicate values in Google Sheets.
- Highlight the cells you wish to format, and then click on Format > Conditional Formatting.
- The Apply to Range section will already be filled in.
- From the Format Rules section, select Custom Formula from the drop-down list and type in the following formula to look for text at the beginning of your cell.
=COUNTIF($B$4:$E$11,B4)>$G$10
- Select the fill style for the cells that meet the criteria.
- Click Done to apply the rule. In this case we are highlighting cells with duplicate values, that is, with two or more repetitions.
- Change the value in G10 to see the results change accordingly.