Use Excel Conditional Formatting for Chapter and Subchapter Rows
Question details
Color parent chapter rows according to status values in the task or subchapter rows beneath them.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains chapter rows and related child rows whose statuses should determine the chapter formatting.
- Observed behavior
- The desired result is for a parent row to change color when its child rows contain a specified status value.
Decide which cell value represents each status, such as x for a task that needs attention. Identify the child-row range for each chapter, or add columns that identify chapters and row types.
Format a chapter row with a COUNTIF rule
Use this method when each chapter has a clearly defined block of child rows.
Enter a status such as x in the relevant task cells. For this example, the chapter is on row 5 and its child cells are in B6:M10.
Select A5:M5, or the portion of row 5 that you want to color.
Go to Home > Conditional Formatting > New Rule, choose Use a formula to determine which cells to format, and enter =COUNTIF($B$6:$M$10,"x")>0.
Select Format, choose a fill color on the Fill tab, and confirm the rule. The selected chapter row will be colored when at least one cell in B6:M10 contains x.
Select each additional chapter row and create a rule that references its own child-row range. Replace x with another status value if needed.

Match chapter rows to tasks with COUNTIFS
Use chapter identifiers when tasks are spread across a larger table or multiple chapters.
Color chapter rows by task status in WPS Spreadsheets
Use a formula-based conditional formatting rule in WPS Spreadsheets to highlight a chapter row when its child cells contain a status such as x.
- 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
- 2. Select the parent row: Select the cells to color, such as A5:M5, and make sure the child status values are in B6:M10.
- 3. Create the rule: Go to Home > Conditional Formatting > New Rule, choose a formula-based rule, and enter =COUNTIF($B$6:$M$10,"x")>0.
- 4. Set the format: Choose a fill color in the rule's formatting options and confirm. Save the workbook to keep the rule.

Frequently Asked Questions
Can Excel color a chapter row based on a child cell's fill color?
Standard conditional formatting formulas do not directly evaluate a cell's fill color. Store a status such as x in the child cell and use that value in a COUNTIF or COUNTIFS rule.
How do I color the whole chapter row instead of one cell?
Select the full range to color, such as A5:M5, before creating the rule under Home > Conditional Formatting > New Rule.
How can I use different colors for different task statuses?
Create a separate conditional formatting rule for each status. For example, use COUNTIF($B$6:$M$10,"x")>0 for one fill and COUNTIF($B$6:$M$10,"y")>0 for another. If both can be true, check the rule order under Conditional Formatting > Manage Rules.
How do I handle tasks that are not in one continuous block?
Add a chapter ID to each task and use COUNTIFS to match that ID and the desired status. Add a subsection ID as another criterion if you also need subsection-level formatting.




