Conditional formatting: practice exercises
Highlight cells rules, duplicates, top N, rules with formulas. 7 exercises on real-looking data, each checked as you go. The full lesson is part of Pro.
This lesson is done with the tools on a practice sheet in the lesson, just as in Excel, and each task is checked as you go.
How it works
Conditional formatting colours cells by a rule, such as “greater than 5,000”. The colours update by themselves when the numbers change, so it's ideal for spotting what needs attention.
Select the cells first, then choose a rule. In Excel it's on the Home tab under Conditional Formatting: Highlight Cells Rules, Top/Bottom Rules, or New Rule → Use a formula. Here, use the Conditional formatting button above the sheet.
=$B2="Sales"
Rules, not paint
You could colour cells by hand, but the colours would be wrong as soon as the numbers changed. A conditional formatting rule checks every cell, every time.
- Select the cells the rule is for.
- Pick a rule: Greater than, Less than, Between, Equal to, Text that contains, Duplicate values, Top or Bottom N.
- Type the value and choose a colour.
“Greater than 5000” doesn't include 5000 itself. Rules stay until you clear them: Clear rules from selected cells.
Rules with a formula
For anything the ready-made rules can't do, such as colouring a whole row, use Use a formula. Write a test that gives TRUE or FALSE, for the active cell of your selection: the one you started selecting from, usually the top-left.
Excel moves the formula for every other cell, as if it were copied. To colour A2:D20 for the Sales team, use =$B2="Sales". The $ keeps every column looking at column B, and the 2 (no $) lets each row look at its own row.
In Excel it's New Rule, Use a formula to determine which cells to format. On a Mac, set Style to Classic first.
What you'll practise
- Colour every sale greater than £4,000 with a light red fill: select D2:D13, then Conditional formatting → Greater than.
- Colour attendance below 90% with a yellow fill. (Typing 90% or 0.9 both work.)
- Make every Overdue status stand out with a light red fill, using a Text that contains rule on C2:C11.
- Some people have signed up twice. Highlight the duplicate values in A2:A15 with a yellow fill.
- Colour the top 3 sales with a green fill, using a Top N items rule.
- Colour the whole row (A to D) of everyone in the Marketing team, green. Select A2:D13 and use a formula rule: write it for row 2, and lock the column with $ so every cell looks at column B.
- Remove the conditional formatting from the sales in D2:D13, but keep the formatting on the regions in column C.
Guides with worked examples: Conditional formatting with a formula: colour a whole row · Finding and removing duplicates in Excel · If a cell contains text in Excel · AND and OR in Excel: two conditions in one IF