Highlight Values Appearing Fewer Than Four Times in Excel
Question details
Highlight cells containing values that occur fewer than four times in a specified range.

- 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.
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.
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.
Select A1:A8, or select the range containing the values you want to highlight.
Go to Home > Conditional Formatting > New Rule, then choose Use a formula to determine which cells to format.
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.
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.

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. Open your spreadsheet: Open WPS Spreadsheet and select the cells to format, such as A1:A8.
- 2. Add a rule: Choose Home > Conditional Formatting > New Rule, then select the option to use a formula.
- 3. Enter COUNTIF: Enter =COUNTIF($A$1:$A$8,A1)<4, adjusting the fixed counting range and first-cell reference for your selection.
- 4. Set the highlight: Choose a fill color under Format and confirm the rule to highlight matching cells.

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.




