Color Excel Cells by Children's Ages Using Conditional Formatting
Question details
Automatically color worksheet cells according to children's age groups, using full-year or half-year ranges.

- 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.
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.
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.
In Excel, select B2:B100, with B2 as the first cell in the selection.
Choose Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.
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.
Click Format, choose a color on the Fill tab, and click OK to save the rule.
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.

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. Open the worksheet: Open WPS Office, choose Spreadsheets, and open your Excel workbook.
- 2. Select the age range: Select the cells containing ages, such as B2:B100.
- 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. Set colors and save: Choose a fill color for the rule, add separate rules for the other age ranges, and save the workbook.

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.




