Create conditional formatting rules that use formulas
- 1Select the whole range, starting from the first data row: A2:D6.
- 2Home › Conditional Formatting › New Rule › Use a formula to determine which cells to format.
- 3Type the formula for the first row: =$B2="Late".
- 4Format: the fill. OK, OK.
The formula is written for the top-left cell of the selection and must be TRUE where the format belongs. The $ before B keeps every cell in a row looking at column B.
What the MO-211 task asks
Seven of our ten MO-211 practice exams have one, almost always a whole-row highlight: “Create a conditional formatting rule on A4:G31 that uses a formula to fill the whole row with the light red FFC7CE when the Status column equals Overdue.”
Some need two conditions: “a formula rule on A4:F19 filling amber FFEB9C where Occupancy is under 40% and the film still has more than 3 shows a week. Both conditions must hold.” That is AND inside the formula.
Our grader checks that the rule is a formula rule over the task's range with the task's fill, and that it shades exactly the right rows. A rule that shades the wrong rows, or only one column, fails the second check.
Worked examples
Set up the grid below to follow along. Each example starts from it as shown; every result is what Excel showed.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Status | Qty | Due |
| 2 | A-1 | Paid | 4 | 9-Dec-2025 |
| 3 | A-2 | Late | 12 | 19-Mar-2026 |
| 4 | A-3 | Paid | 9 | 27-Jun-2026 |
| 5 | A-4 | Late | 2 | 5-Oct-2026 |
| 6 | A-5 | Open | 15 | 24-Nov-2026 |
- 1Select A2:D6, A2 active. New Rule › Use a formula: =$B2="Late". Fill light red. OK.
Every cell in row 3 tests B3, because $B is locked and the 2 moves down a row at a time.
- 1Same range: =AND($B2="Late",$C2>10). Fill amber.
A-4 is late but has a quantity of 2, so AND is FALSE. With OR instead, rows 3, 5 and 6 would be shaded.
- 1Same range: =B2="Late".
Each cell tests the cell one column to its right: A3 tests B3, but B3 tests C3. Lock the column.
- 1Same range: =$B$2="Late".
Every cell tests B2, which says Paid. Leave the row number free.
- 1Same range, A2 active: =$B3="Late".
The formula belongs to the active cell, A2, so it must name row 2.
- 1Select A2:D6. New Rule › Use a formula: =$B2="Late". Fill FFC7CE.
The first example, done in Excel on the same sheet.
Watch it done in Excel
The last example above, recorded in real Excel on the same grid.
Exam traps
For a whole row, lock the column and not the row: =$B2. =B2 shades one column, and =$B$2 tests the same cell for every row.
With A1:D6 selected and A1 active, =$B2="Late" shades rows 2 and 4. Start the selection on the first data row, or write the formula for the active cell's row.
Any number but 0 counts as TRUE. =C2-10 on the Qty cells shades all five, because none of them is exactly 10. Write a comparison, such as =C2>10.
Our tasks give the fill as a hex code, such as FFC7CE. Set it under Format › Fill › More Colors, not from the nearest swatch.
FAQ
Does capitalisation matter in the text?
No. =$B2="late" shades the same rows as =$B2="Late".
Why not use Highlight Cells Rules?
A Highlight rule formats only the cell it tests. To shade the whole row, or to test two columns at once, you need a formula.
Can the formula use functions?
Yes, any that return TRUE or FALSE, such as AND, OR and NOT, or a comparison with one inside it, such as =$D2<TODAY() for due dates that have passed.
New to this?
This page covers what the exam asks. For the full how-to, read our guide on dfwexcel.com.
Highlight rows with a formula — dfwexcel.comTry it under exam conditions
Take a full, timed MO-211 practice exam, upload the workbook you built, and get a score out of 1000 with a per-task breakdown of where the points went. Your first one is free.
No credit card needed.
