Formatting Issues

Use Excel Conditional Formatting for Chapter and Subchapter Rows

Aamir Naveed AkramAamir Naveed Akram Dec 2, 2026 868 views

Question details

Color parent chapter rows according to status values in the task or subchapter rows beneath them.

Use Excel Conditional Formatting for Chapter and Subchapter Rows
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.
Before you start

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.

Solution 1Recommended

Format a chapter row with a COUNTIF rule

Use this method when each chapter has a clearly defined block of child rows.

1
Enter status values

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.

2
Select the chapter row

Select A5:M5, or the portion of row 5 that you want to color.

3
Create a formula rule

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.

4
Choose a fill

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.

5
Repeat for other chapters

Select each additional chapter row and create a rule that references its own child-row range. Replace x with another status value if needed.

Format a chapter row with a COUNTIF rule
Use values rather than fill colors: Standard conditional formatting formulas do not directly test another cell's fill color. Base both the task and chapter formatting on the underlying status values instead.
WPS Spreadsheets

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. 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 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. 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. 4. Set the format: Choose a fill color in the rule's formatting options and confirm. Save the workbook to keep the rule.
Highlight chapter rows based on task status valuesUse COUNTIF formulas for defined child-row rangesOpen and edit Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.