Formatting Issues

How to Highlight More Than Two Occurrences in 30 Days with Excel Conditional Formatting

Steve KSteve K Nov 10, 2026 869 views

Question details

The user needs a conditional formatting rule to count and highlight instances where the same person has more than two recorded events (such as falls) within a rolling 30-day period.

How to Use Conditional Formatting for More Than Two Events in 30 Days
Product
Excel / WPS Spreadsheets
Device & OS
not provided
Scenario
Tracking recurring events for specific individuals over a rolling 30-day window to visually flag cells when the frequency threshold is exceeded.
Observed behavior
The user wants to format a specific cell (e.g., in column H) when a custom formula detects that a person's name appears more than twice in the past 30 days based on their corresponding event dates.
Before you start

Ensure your dataset is organized with clear, consistent columns for the person's name (e.g., Column A) and the exact date of the event formatted as valid dates (e.g., Column C).

Solution 1Recommended

Apply a Custom COUNTIFS Formula in Conditional Formatting

Use a formula-based conditional formatting rule to dynamically count occurrences within a rolling 30-day window for each person.

By utilizing the COUNTIFS function, you can evaluate multiple criteria at once. In this scenario, the formula checks if the name matches the current row and if the date falls within the 30 days prior to the current row's date.

1
Select the target range

Highlight the cells you want to format. For example, select cells H2 through H100.

2
Create a new formatting rule

Go to the Home tab on the ribbon, click 'Conditional Formatting', and select 'New Rule'.

3
Enter the custom formula

Choose 'Use a formula to determine which cells to format' and enter: =COUNTIFS($A$2:$A$100,$A2,$C$2:$C$100,">="&$C2-30,$C$2:$C$100,"<="&$C2)>2

4
Set the format

Click the 'Format' button, navigate to the Fill tab, select a highlight color (such as red or yellow), and click 'OK' to apply the rule.

Apply a Custom COUNTIFS Formula in Conditional Formatting
Dynamic Reference Checking: This formula uses a mix of absolute references (like $A$2:$A$100) and mixed references (like $A2) to ensure the criteria adapt dynamically as the rule evaluates each row down the column.
Smart Data Analysis

Highlight Data Dynamically in WPS Spreadsheets

WPS Spreadsheets provides robust conditional formatting capabilities, allowing you to seamlessly apply complex formulas like COUNTIFS to analyze and highlight rolling date ranges.

  1. 1. Open your dataset: Launch WPS Spreadsheets and open the workbook containing your event tracking data.
  2. 2. Access conditional formatting: Highlight the target column, navigate to the Home tab, and click on 'Conditional Formatting' > 'New Rule'.
  3. 3. Apply the COUNTIFS rule: Select 'Use a formula', paste your rolling 30-day COUNTIFS formula, customize the fill color, and click OK to highlight your data instantly.
Fully compatible with Microsoft Excel conditional formatting rules and formulas.Lightweight, fast, and runs smoothly on Windows, Mac, Linux, and mobile devices.Intuitive interface for managing multiple conditional formatting priorities easily.Built-in advanced data analysis tools completely free to use.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my conditional formatting formula highlighting the wrong cells?

This usually happens due to incorrect cell references. Ensure you are using absolute references for your data arrays (e.g., $A$2:$A$100) and mixed references for the criteria checking the current row (e.g., $A2), so the formula correctly shifts evaluation row by row.

Can I change the rolling period to 90 days instead of 30?

Yes. You can easily modify the formula to accommodate any time frame. Simply change the '-30' in the formula string ">="&$C2-30 to '-90' to evaluate occurrences over a 90-day rolling window.

Does the COUNTIFS formula work properly if there are blank cells in the date column?

Blank cells might be evaluated as a zero value (representing an old date), which can throw off your count. To prevent false highlights, add an additional condition to your COUNTIFS formula, such as $C$2:$C$100,"<>", to ensure blank cells are ignored.