Formatting Issues

Highlight Excel Duplicates While Excluding N/A Values

Chanuka GeekiyanageChanuka Geekiyanage Nov 25, 2026 871 views

Question details

Create a conditional formatting rule that highlights duplicate Excel entries without highlighting cells containing N/A.

How to Highlight Excel Duplicates but Exclude N/A Values
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to identify repeated entries in a range while ignoring N/A placeholders.
Observed behavior
Duplicate entries are highlighted, while cells containing the text N/A remain unformatted.
Before you start

Identify the range to check and its first cell. The example below uses A2:A12 and treats N/A as text, not as the Excel #N/A error.

Solution 1Recommended

Create a formula rule to highlight duplicates except N/A

Use a conditional formatting formula to count repeated values and exclude the text N/A.

1
Select the range

Select cells A2:A12, or select the range you want to check.

2
Create a formula rule

Go to Home > Conditional Formatting > New Rule, then choose Use a formula to determine which cells to format.

3
Enter the formula

In the formula box, enter =AND(COUNTIF($A$2:$A$12,$A2)>1,$A2<>"N/A"). Replace $A$2:$A$12 with your selected range and $A2 with its first cell.

4
Choose the highlight

Click Format, choose a fill color, and click OK. Click OK again to apply the rule.

Create a formula rule to highlight duplicates except N/A
Text versus error values: The formula excludes the text N/A. To prevent actual #N/A errors from causing a formula error, use =IFERROR(AND(COUNTIF($A$2:$A$12,$A2)>1,$A2<>"N/A"),FALSE) instead.
Highlight duplicates in WPS

Highlight duplicates except N/A in WPS Spreadsheet

Use a formula-based conditional formatting rule in WPS Spreadsheet to highlight repeated entries while leaving text N/A placeholders unformatted.

  1. 1. Open the workbook: Open your Excel workbook in WPS Spreadsheet and select the range to check, such as A2:A12.
  2. 2. Add a rule: On the Home tab, open Conditional Formatting and choose New Rule. Select the option to use a formula.
  3. 3. Enter the formula: Enter =AND(COUNTIF($A$2:$A$12,$A2)>1,$A2<>"N/A") and adjust the references to match your selected range.
  4. 4. Apply the format: Choose a fill color in the formatting options, then confirm the rule to highlight matching duplicates.
Highlight repeated values without marking N/A placeholdersOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceWork with conditional formatting in a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

How do I change the formula for a different range?

Replace $A$2:$A$12 with the range you selected and replace $A2 with its first cell. For example, for B3:B20, use =AND(COUNTIF($B$3:$B$20,$B3)>1,$B3<>"N/A").

Does the formula exclude actual #N/A errors?

The comparison excludes the text N/A, not the #N/A error. Wrap the formula in IFERROR, as shown in the solution note, to leave cells with errors unformatted.

How can I exclude blank cells too?

Add a nonblank test to the AND formula: =AND(COUNTIF($A$2:$A$12,$A2)>1,$A2<>"N/A",$A2<>""). Enter it in the conditional formatting rule and adjust the range as needed.

Will the rule highlight every occurrence of a duplicate?

Yes. COUNTIF checks how many times each value occurs in the selected range, so every occurrence is highlighted when the count is greater than one, except for text N/A.