Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Highlighting Duplicates in Excel: A Complete Guide

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Highlighting duplicates in Excel is achieved using the Conditional Formatting tool, which automatically applies a specific color or style to any cell that contains a value appearing more than once in a selected range. This process allows you to visually audit your data, identify redundant entries, and clean up spreadsheets without manually scanning thousands of rows. To do this quickly, select your data, go to the Home tab, click Conditional Formatting > Highlight Cells Rules > Duplicate Values, and choose your preferred formatting style.

What You'll Need

  • A computer with Microsoft Excel installed (works on Excel 365, 2021, 2019, 2016, and 2013).
  • A dataset containing the information you wish to check for redundancies.
  • Basic knowledge of how to select cells or ranges in a spreadsheet.

Step-by-Step

  1. Open your workbook and select the target range. Click on a single cell to select a specific column, or click and drag your mouse to highlight a specific block of cells. If you want to check an entire sheet for duplicates, press Ctrl + A. Note that labels may differ slightly depending on your version of Excel or region, but the core functionality remains the same across desktop versions.
  2. Navigate to the Home Tab. Ensure you are on the main ribbon at the top of the screen. The Home tab contains the primary formatting tools used for general spreadsheet management.
  3. Open the Conditional Formatting menu. In the "Styles" group of the Home tab, click the button labeled "Conditional Formatting." This opens a dropdown menu containing several rule-based formatting options.
  4. Select Highlight Cells Rules. Hover your mouse over the first option in the menu, "Highlight Cells Rules." A secondary side-menu will appear with various criteria such as "Greater Than," "Less Than," and "Text that Contains."
  5. Choose Duplicate Values. At the bottom of the Highlight Cells Rules list, click "Duplicate Values..." This will trigger a small pop-up dialog box.
  6. Configure the rule settings. In the dialog box, you will see two dropdown menus. The first dropdown allows you to choose between "Duplicate" and "Unique." Ensure "Duplicate" is selected. The second dropdown allows you to choose the formatting style. Common presets include "Light Red Fill with Dark Red Text" or "Yellow Fill with Dark Yellow Text." You can also select "Custom Format..." to choose your own specific fill color, font style, or border.
  7. Apply the formatting. Click "OK." Excel will immediately scan the selected range and apply the chosen color to every cell that has a matching counterpart within that same selection.
  8. Verify the results. Scroll through your data to ensure the highlights are appearing where expected. If you change a value in a highlighted cell so that it is no longer a duplicate, the color will automatically disappear in real-time.

Common Mistakes

One of the most frequent errors users make is selecting the wrong range before applying the rule. If you select only one column but your duplicates span across multiple columns, Excel will only highlight duplicates within that specific column. Conversely, if you select the entire sheet, Excel may highlight cells that are technically duplicates (like multiple empty cells or common headers) which can clutter the view and make the data harder to read.

Another common mistake is ignoring leading or trailing spaces. Excel treats "Apple" and "Apple " (with a space at the end) as two completely different values. Because they are not identical character-for-character, the Conditional Formatting tool will not flag them as duplicates. This often leads users to believe the tool is broken when the issue is actually poor data hygiene.

Users also frequently confuse "Highlighting" with "Removing." It is important to remember that Conditional Formatting only changes the visual appearance of the cell; it does not delete the duplicate data. To actually remove the entries, you must use the "Remove Duplicates" tool found under the Data tab, which is a separate process entirely.

Finally, applying multiple conflicting conditional formatting rules to the same range can cause confusion. If you have a rule that turns cells green based on a value and another that turns them red if they are duplicates, the rule with the higher priority in the "Manage Rules" manager will take precedence, potentially hiding the duplicates you are trying to find.

Tips

To make your duplicates easier to find in a massive dataset, use the Filter tool after highlighting. Once the cells are colored, click the filter arrow in your header row, select "Filter by Color," and choose the highlight color you applied. This collapses the list to show only the duplicate entries, allowing you to review them side-by-side without scrolling through thousands of unique rows.

If you need to find duplicates based on a combination of two columns (for example, where both First Name and Last Name match), Conditional Formatting's built-in "Duplicate Values" tool won't work because it looks at cells individually. Instead, create a "helper column" using the concatenation formula =A2&B2. This merges the two values into one string. You can then apply the duplicate highlighting rule to that helper column to find rows where the combined identity is repeated.

For those who prefer a cleaner look, use a subtle fill color like light grey or light blue. Bright red can be distracting if you are working with a large amount of data for an extended period. Using a custom format allows you to change only the font color or add a thick border, which can be more professional for reports that will be shared with others.

If you find yourself performing this task frequently on different sheets, consider converting your data range into an official Excel Table (Ctrl + T). When you apply conditional formatting to a table, the rule automatically expands to new rows as you add data, meaning you don't have to re-apply the formatting every time you update your list.

Troubleshooting

If the duplicates are not highlighting as expected, first check for hidden characters. Use the =TRIM() function in a separate column to remove extra spaces from your data, then apply the highlighting to the trimmed results. This is the most common reason why visually identical cells aren't flagged.

If the cells are highlighted but you believe they aren't duplicates, check if you have "Case Sensitivity" issues. Standard Excel conditional formatting is not case-sensitive (it treats "APPLE" and "apple" as the same). If you need to distinguish between cases, you will need to use a custom formula involving the EXACT function rather than the built-in duplicate tool.

If the formatting simply isn't appearing, check the "Manage Rules" section. Go to Conditional Formatting > Manage Rules and ensure the rule is active and that the "Applies to" range matches the cells you are currently looking at. Sometimes, if you move or copy cells, the range in the rule can become fragmented (e.g., =$A$1:$A$10, $A$15:$A$20), which can cause inconsistent behavior.

If your computer becomes extremely slow after applying this rule to a very large dataset (hundreds of thousands of rows), it is because conditional formatting is a "volatile" process that recalculates frequently. To fix this, you can copy the highlighted cells and paste them as values, or use a formula in a helper column (like =COUNTIF($A$1:$A$1000, A1)>1) to identify duplicates and then filter by that formula's result.

Frequently Asked Questions

Can I highlight only the second or third occurrence of a duplicate?

The built-in "Duplicate Values" tool highlights all instances of the value. To highlight only the repetitions (leaving the first instance clean), you must use a custom formula: =COUNTIF($A$1:A1, A1)>1. This tells Excel to only highlight a cell if it has appeared previously in the range above it.

Does this work across multiple different worksheets?

No, the built-in conditional formatting tool only works within a single selected range on one sheet. To find duplicates across different sheets, you will need to use a VLOOKUP or MATCH formula to compare one list against another.

Will highlighting duplicates slow down my Excel file?

In small to medium datasets, there is no noticeable impact. However, in very large spreadsheets, having thousands of conditional formatting rules can increase calculation time and cause lag when scrolling or entering data.

How do I remove the highlighting once I am done?

To clear the colors, select the range, go to Conditional Formatting > Clear Rules, and choose either "Clear Rules from Selected Cells" or "Clear Rules from Entire Sheet."

Can I highlight duplicates based on a specific word within a cell?

The "Duplicate Values" tool requires the entire cell content to be identical. If you want to find cells that contain the same word but have other different text, you should use the "Text that Contains" rule or a complex formula involving the SEARCH function.

Is there a way to highlight unique values instead?

Yes. When you open the "Duplicate Values" dialog box, there is a dropdown menu that defaults to "Duplicate." Simply change this selection to "Unique," and Excel will highlight every cell that appears only once in the range.