Formatting Issues

Color Excel Cells by Children's Ages Using Conditional Formatting

Khadija KhanKhadija Khan Nov 14, 2026 870 views

Question details

Automatically color worksheet cells according to children's age groups, using full-year or half-year ranges.

Color Excel Cells by Children's Ages Using Conditional Formatting
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet groups children by age and needs colors to update when an age changes.
Observed behavior
Cells should display the color assigned to the age range that each child belongs to.
Before you start

Decide which column will contain numeric ages, define the age boundaries and choose a color for each group. For half-year groups, enter ages with decimal values, such as 5.5, rather than whole years alone.

Solution 1Recommended

Create formula-based rules for each age group in Excel

Use conditional formatting rules to update cell colors automatically as numeric ages change.

The examples assume ages are in B2:B100. Replace that range and the column reference in each formula to match your worksheet. Choose either the full-year example or the half-year examples for the same age span to avoid overlapping colors.

1
Select the age cells

In Excel, select B2:B100, with B2 as the first cell in the selection.

2
Create a formula rule

Choose Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.

3
Set an age range

For ages from 5 up to, but not including, 6, enter =AND(ISNUMBER($B2),$B2>=5,$B2<6). For half-year groups instead, use =AND(ISNUMBER($B2),$B2>=5,$B2<5.5) for the first group and =AND(ISNUMBER($B2),$B2>=5.5,$B2<6) for the second.

4
Choose a color

Click Format, choose a color on the Fill tab, and click OK to save the rule.

5
Add the other groups

Repeat Home > Conditional Formatting > New Rule for each remaining range, using a different fill color. Use Conditional Formatting > Manage Rules to check the formulas and the Applies to range.

Create formula-based rules for each age group in Excel
Adjust the examples to your worksheet: The exact rules depend on your age boundaries and colors. Use a sample or anonymized screenshot when asking for help with a specific layout.
Conditional formatting in WPS Spreadsheets

Color Age Groups Automatically in WPS Spreadsheets

Open your worksheet in WPS Spreadsheets and create formula-based conditional formatting rules for each age range.

  1. 1. Open the worksheet: Open WPS Office, choose Spreadsheets, and open your Excel workbook.
  2. 2. Select the age range: Select the cells containing ages, such as B2:B100.
  3. 3. Add a formula rule: Choose Home > Conditional Formatting > New Rule and select the option to use a formula. For ages from 5 up to 6, enter =AND(ISNUMBER($B2),$B2>=5,$B2<6).
  4. 4. Set colors and save: Choose a fill color for the rule, add separate rules for the other age ranges, and save the workbook.
Automatically updates age-group colors when numeric ages changeSupports Excel workbook formats, including XLSX and XLSUses a familiar spreadsheet interfaceFree to use for everyday spreadsheet tasks
microsoft office alternative - wps office

Frequently Asked Questions

Will the color change when I update an age?

Yes. Once the conditional formatting rule applies to the cell, Excel reevaluates the formula when the age changes and displays the matching fill color.

Can I use half-year groups if ages are entered as whole numbers?

Whole-year ages do not distinguish, for example, 5 years from 5 years and 6 months. Enter numeric decimal ages such as 5.5, or calculate a suitable age value from birth dates before applying half-year rules.

How can I color an entire row based on the age in column B?

Select the rows' data range, such as A2:D100, before creating the rule. Use a formula such as =AND(ISNUMBER($B2),$B2>=5,$B2<6); the fixed B column checks the age for each row.

Why might a cell show an unexpected color?

Check Home > Conditional Formatting > Manage Rules for overlapping age ranges, rule order and the Applies to range. Also verify that ages are stored as numbers and that the formula references the first row of the selected range.