Manage conditional formatting rules
Conditional formatting8 minPremium
Builds on Show size with data bars, color scales and icon sets and Highlight whole rows with a formula rule.
A training coordinator in Ottawa colors the scores of a forklift safety quiz: under 60 in red, for a retake, and under 70 in yellow, for a refresher. Since a colleague added the yellow rule, the people who failed show yellow, and scores pasted below the old list show no color at all.
How it works
Home > Conditional Formatting > Manage Rules opens the Conditional Formatting Rules Manager. With Show formatting rules for set to This Worksheet, it lists every rule on the sheet with its format and its Applies to range.
Applies to is the range a rule covers. Rows pasted below it get no color until you widen it there. Clear Rules, on the same menu, removes the rules from the selected cells or the entire sheet.
Excel applies the rules from the top, and a new rule goes to the top. When two rules are true for a cell and set the same thing, such as the fill, the higher one wins. When they set different things, such as a fill and bold text, the cell gets both. Move Up and Move Down change the order:
| Score | Below 70 (yellow) | Below 60 (red) | Red rule on top | Yellow rule on top |
|---|---|---|---|---|
| 85 | FALSE | FALSE | no fill | no fill |
| 64 | TRUE | FALSE | yellow | yellow |
| 52 | TRUE | TRUE | red | yellow |
In Excel for Windows, each rule also has a Stop If True check box: where that rule is true, the rules below it are skipped for that cell. It can't be checked on bars, scales or icons, but a highlight rule above them can stop them. Without it, put the exception in the lower rule's formula with AND.
Example
In the quiz sheet's Rules Manager, select the red rule, Cell Value < 60, and click Move Up until it sits above the yellow one: the failed scores turn red again. Then change both Applies to ranges from =$C$2:$C$30 to =$C$2:$C$45, and the new scores get their colors.
Common mistakes
- Opening the manager on Current Selection, which hides the rules on other cells. Choose This Worksheet.
- Two rules that set the fill in the wrong order. Put the more urgent one on top.
- Expecting the top rule to hide the formats below it. Formats that don't clash, such as bold and a fill, both show unless Stop If True is checked.
In short
- Manage Rules, set to This Worksheet, lists every rule with its Applies to range.
- Rules apply from the top, and where two set the same thing, the higher one wins.
- Stop If True keeps the rules below a rule away from the cells where it's true.
Practice
Premium4 exercises: 3 conditional formats and 1 quiz question.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in