Conditional formatting in Excel: rule types, formula-based rules and Manage Rules
What conditional formatting is and how it works: Highlight Cells, Top/Bottom, Data Bars, Color Scales, Icon Sets, coloring whole rows with a formula, and the $ trap.
Conditional formatting automatically changes a cell’s color, font or icon based on its value. You write the rule once — “red if the target wasn’t met” — and Excel keeps watching: when the value changes, so does the color.
In a table of hundreds of numbers, problems are hard to spot by eye. Conditional formatting shows what matters in the first second: who is behind target, which product is running out, which payment is overdue.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125% | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
Your first rule: missed targets in red
1
Select the cells the rule applies to — the Target met column, C2:C7. Leave the header out.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125%1 | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
2
Click Главная → Условное форматирование. The menu lists every rule type — we need Highlight Cells Rules.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125% | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
3
Choose Less Than..., type 100% as the value, and pick a preset format on the right — Light Red Fill with Dark Red Text. While the box is open, you see a live preview in the table.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125% | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
4
Click OK. If Sardor’s result now changes from 99% to 105%, the red fill disappears on its own — the rule is always on.
Rule types: which one when
- Highlight Cells Rules — color by an exact condition: greater than, less than, between, equal to, text that contains, a date, duplicate values. The question: “which cells meet the condition?”
- Top/Bottom Rules — the largest or smallest N items (or N%), above/below average. The question: “who is best, who is worst?”
- Data Bars — a bar inside the cell sized by the value. For comparing magnitudes.
- Color Scales — a shade by value (red → yellow → green). To see the “hot” and “cold” areas of a big table.
- Icon Sets — arrows, traffic lights, flags. To show status at a glance.
- New Rule... → Use a formula — any condition as a formula. The most powerful option.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 95 | 110 | 128 | |
| 3 | Samarkand | 72 | 80 | 91 | |
| 4 | Bukhara | 48 | 55 | 67 | |
| 5 | Andijan | 60 | 52 | 74 | |
| 6 |
A formula rule: color the whole row
1
Preset rules color only the cell itself. To color a whole row, select the whole table (A2:C7, without the header) → Условное форматирование → New Rule....
2
Choose Use a formula to determine which cells to format and enter =$C2<100%. The formula is written for the first row of the selection — Excel adjusts it for the other rows by itself.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125% | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
3
Click Format..., pick a color on the Fill tab and click OK twice. The full rows of employees who missed their target are colored.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales | Target met | |
| 2 | Aziz | 12 500 000 | 125% | |
| 3 | Dilnoza | 8 200 000 | 82% | |
| 4 | Javohir | 15 300 000 | 153% | |
| 5 | Malika | 6 100 000 | 61% | |
| 6 | Sardor | 9 900 000 | 99% | |
| 7 | Nodira | 11 000 000 | 110% | |
| 8 |
Managing rules
Условное форматирование → Manage Rules... lists every rule. Set Show formatting rules for at the top to This Worksheet to see all the rules on the sheet.
- Applies to — the range the rule affects. Extend it here when rows are added.
- Order — rules are checked from top to bottom; if two rules set the same property (say, the fill color), the upper one wins. Reorder with the arrows.
- Stop If True — once this rule applies, the rules below are skipped for that cell.
- Clear Rules → Clear Rules from Selected Cells or from Entire Sheet.
Pro level: formula rule recipes
- Put the threshold in a cell:
=$C2<$F$1— change the target in F1 and the colors update instantly, without reopening the rule. - Overdue payments:
=И($D2<СЕГОДНЯ();$E2="Unpaid"). - Weekends:
=ДЕНЬНЕД($A2;2)>5— Saturday and Sunday rows. - Banded rows (zebra):
=ОСТАТ(СТРОКА();2)=0. - Test the formula first: before creating the rule, type it as a normal formula in an empty column next to the table and fill it down. The rows showing TRUE are exactly the rows that will be colored.
Conditional formatting doesn’t change values: you can’t SUM by color, but Filter by Color and Sort by Color do work.
Try it in the simulator
Test a rule formula: type =$C2<100% in D2 and fill it down to D7. The rows showing TRUE are exactly the ones conditional formatting would color with this formula. Change C6 to 105% and watch the result change.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Sales | Target met | Color it? | ||||||||||||||||||||
| 2 | Aziz | 12500000 | 1,25 | |||||||||||||||||||||
| 3 | Dilnoza | 8200000 | 0,82 | |||||||||||||||||||||
| 4 | Javohir | 15300000 | 1,53 | |||||||||||||||||||||
| 5 | Malika | 6100000 | 0,61 | |||||||||||||||||||||
| 6 | Sardor | 9900000 | 0,99 | |||||||||||||||||||||
| 7 | Nodira | 11000000 | 1,1 | |||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.