Formatting Issues

How to Apply Conditional Formatting for Repeated Dates Across Multiple Years

Bushra ParveenBushra Parveen Nov 10, 2026 868 views

Question details

The user wants to highlight specific days and months where social media posts occurred across multiple distinct years, using color codes based on the number of years.

How to Apply Conditional Formatting for Repeated Dates Across Multiple Years
Product
Spreadsheet
Device & OS
not provided
Scenario
Tracking social media post occurrences over several years and dynamically highlighting a calendar or summary grid based on year frequency.
Observed behavior
Needs yellow cell formatting for posts occurring in at least two distinct years, green for at least three distinct years, and no formatting for one or zero years.
Before you start

Ensure your raw data includes clearly defined columns for the day, month, and year of the social media posts so that the formulas can reference them accurately.

Solution 1Recommended

Use Dynamic Array Formulas (FILTER and UNIQUE)

Best for modern spreadsheet versions that support dynamic arrays to directly count distinct years matching a specific month and day.

By combining the FILTER and UNIQUE functions, you can extract only the distinct years for a given date criteria and then count them. This result directly drives your conditional formatting rules.

1
Select the target range

Highlight the summary table or calendar grid where you want the colors to appear.

2
Create the Yellow Rule (>=2 years)

Go to Home > Conditional Formatting > New Rule. Select 'Use a formula to determine which cells to format'. Enter your dynamic formula, such as `=COUNTA(UNIQUE(FILTER(Sheet2!$F$2:$F$100,(Sheet2!$D$2:$D$100=B$1)*(Sheet2!$E$2:$E$100=$A2))))>=2`, and set the cell fill color to Yellow.

3
Create the Green Rule (>=3 years)

Repeat the previous step to add a second rule. Change the condition at the end of the formula to `>=3` and set the cell fill color to Green.

4
Manage rule priority

Go to Conditional Formatting > Manage Rules. Ensure the Green rule (>=3) is at the very top of the list so it evaluates first. Check the 'Stop If True' box next to it if necessary.

Use Dynamic Array Formulas (FILTER and UNIQUE)
Absolute and Relative References: Pay close attention to the dollar signs (e.g., $A2 and B$1) in your formula. Proper mixed references ensure the formula adjusts correctly for every cell in your highlighted grid.

Easily Highlight Data Trends with WPS Spreadsheet

WPS Office provides robust data analysis tools, supporting advanced array formulas and flexible conditional formatting to help you visualize multi-year trends effortlessly.

  1. 1. Open your data file: Launch WPS Spreadsheet and open the workbook containing your social media dates.
  2. 2. Highlight target cells: Select the range of cells in your summary calendar that you want to format.
  3. 3. Add Conditional Formatting: Navigate to the Home tab, click 'Conditional Formatting', and select 'New Rule'.
  4. 4. Input the formula: Choose the formula option, paste your distinct year counting formula, and easily manage rule priorities in the Rules Manager.
Fully compatible with Microsoft Excel conditional formatting rules and formulas.Built-in support for advanced data visualization and highlighting.Lightweight, fast, and free to use for everyday data management tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my green conditional formatting rule not applying?

If your yellow rule (>=2) is above your green rule (>=3) in the Conditional Formatting Rules Manager, the yellow rule will trigger first and stop the formatting process. Move the green rule to the top of the list so higher counts are prioritized.

Can I count distinct values without the UNIQUE function?

Yes. If your software lacks the UNIQUE function, you can insert a PivotTable to summarize distinct occurrences first, or use a helper cell with TEXTJOIN to concatenate values and then count the delimiters mathematically.

How do I apply a formula-based formatting rule to an entire calendar grid?

Select your entire grid before creating the rule, and ensure your formula uses correct mixed references (like `$A2` for locking the row and `B$1` for locking the column). This allows the single formula to adjust dynamically for each individual cell in the selection.