How to Highlight Date Headers for Repeated Values Using Conditional Formatting
Question details
The user needs to set up a conditional formatting rule to highlight a date header whenever specific values (like 1, 2, 3, or 5) appear more than once in the column directly below the header.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Setting up an automated schedule or tracking sheet where the header date needs to be flagged if a combination of specific shift codes or issue values occurs multiple times in that specific day's column.
- Observed behavior
- The goal state is for the date header cell to automatically change its fill color based on a formula that evaluates the frequency of multiple specific constants within the column below.
Ensure your data is organized properly with date headers in a single top row and the corresponding data directly beneath them. Identify the exact row numbers for the data you want the formula to evaluate.
Use SUM and COUNTIFS with an Inline Array Constant
This method uses an inline array directly within a COUNTIFS function to dynamically count specific values and trigger the header formatting.
By nesting a COUNTIFS function inside a SUM function, you can evaluate multiple criteria at once without needing complex helper columns. The array `{1,2,3,5}` allows the formula to check for any of these specific numbers simultaneously.
Click and drag to select the header cells that contain your dates (for example, C8:Z8). Ensure the active cell is the first column in your selection.
Navigate to the Home tab on the ribbon, click on Conditional Formatting, and select 'New Rule' from the dropdown menu.
Choose 'Use a formula to determine which cells to format'. In the formula box, enter `=SUM(COUNTIFS(C9:C16,{1,2,3,5}))>1`. Make sure `C9:C16` refers to the data range in the first column of your selection, with relative column references (no $ before the letter).
Click the Format button, go to the Fill tab, choose your preferred highlight color, and click OK twice to apply the rule to your headers.

Create a Defined Name for the Values Array
If you need to manage or update the list of target values frequently, creating a named range or defined constant array makes the conditional formatting formula easier to maintain.
Easily Apply Advanced Conditional Formatting with WPS Spreadsheet
WPS Spreadsheet provides a robust, user-friendly interface for applying complex conditional formatting rules, fully supporting array formulas and advanced functions like SUM and COUNTIF to simplify data tracking.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data schedule.
- 2. Select the target headers: Highlight the row of date headers you wish to automatically format.
- 3. Create a new rule: Click 'Conditional Formatting' on the Home tab and select 'New Rule'.
- 4. Input the formula: Choose the formula option and enter your SUM and COUNTIF array formula.
- 5. Apply and save: Set the highlight color under the Format menu and click 'OK' to apply.

Frequently Asked Questions
How do I change the target values in the formula later?
If you used an inline array like {1,2,3,5}, you must go to Conditional Formatting > Manage Rules, edit the rule, and update the numbers in the formula. If you used the Name Manager method, simply open the Name Manager, update the 'Refers to' values for your defined name, and the formatting will update automatically across all columns.
Can I reference a range of cells instead of typing an array?
Yes. You can type your target values (1, 2, 3, 5) into a blank range of cells, such as $Z$1:$Z$4. Then, replace the array in your COUNTIF formula with that absolute range reference, for example: =SUM(COUNTIF(C$9:C$16,$Z$1:$Z$4))>1.
Why isn't the formatting applying correctly to all my columns?
This usually happens due to incorrect absolute and relative cell references. Ensure the column references in your formula are relative (e.g., C$9:C$16 without a '$' before the column letter). This allows the rule to adapt and check column D when formatting column D's header, column E for column E's header, and so forth.
Does WPS Spreadsheet fully support conditional formatting with arrays?
Absolutely. WPS Spreadsheet is highly compatible with Microsoft Excel and fully supports using functions like SUM, COUNTIF, and COUNTIFS alongside array constants to trigger dynamic conditional formatting rules.




