Formatting Issues

Highlight Values Appearing Fewer Than Four Times in Excel

Amos GikundaAmos Gikunda Nov 18, 2026 869 views

Question details

Highlight cells containing values that occur fewer than four times in a specified range.

Highlight Values Appearing Fewer Than Four Times in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to identify rare values, including values that appear once, twice, or three times.
Observed behavior
Cells whose values occur fewer than four times should be highlighted automatically.
Before you start

Identify the range to count and the cells to highlight. The example below uses A1:A8 for both; adjust the references if your data is elsewhere.

Solution 1Recommended

Create a COUNTIF Conditional Formatting Rule in Excel

Use this formula-based rule to highlight values that appear one to three times in the selected range.

1
Select the cells

Select A1:A8, or select the range containing the values you want to highlight.

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

Enter =COUNTIF($A$1:$A$8,A1)<4. Replace $A$1:$A$8 with your counting range and A1 with the first cell of your selected range.

4
Choose the format

Click Format, choose a fill color, and click OK to create the rule. Check the Applies to range in Conditional Formatting > Manage Rules if needed.

Create a COUNTIF Conditional Formatting Rule in Excel
Exclude blank cells: To avoid highlighting blanks, use =AND(A1<>"",COUNTIF($A$1:$A$8,A1)<4) instead. Adjust both A1 references and the counting range to match your data.
WPS Spreadsheet

Highlight Rare Values in WPS Spreadsheet

Use a formula-based conditional formatting rule in WPS Spreadsheet to highlight values that occur fewer than four times.

  1. 1. Open your spreadsheet: Open WPS Spreadsheet and select the cells to format, such as A1:A8.
  2. 2. Add a rule: Choose Home > Conditional Formatting > New Rule, then select the option to use a formula.
  3. 3. Enter COUNTIF: Enter =COUNTIF($A$1:$A$8,A1)<4, adjusting the fixed counting range and first-cell reference for your selection.
  4. 4. Set the highlight: Choose a fill color under Format and confirm the rule to highlight matching cells.
Highlight values appearing once, twice, or three timesAdjust the COUNTIF range to fit your dataOpen and edit Microsoft Excel XLS and XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Does the rule highlight values that appear exactly four times?

No. The condition <4 highlights values that appear one, two, or three times. Use <=4 if values appearing exactly four times should also be highlighted.

How do I prevent blank cells from being highlighted?

In the formula rule, use =AND(A1<>"",COUNTIF($A$1:$A$8,A1)<4). Replace A1 and the fixed range with references that match your selection.

Why is the counting range fixed with dollar signs?

The dollar signs keep $A$1:$A$8 fixed as Excel evaluates each selected cell. The relative reference A1 changes for each cell being formatted.

How can I change the range after creating the rule?

In Excel, go to Home > Conditional Formatting > Manage Rules. Edit the rule formula and its Applies to range to match the cells you want to count and highlight.