Excel color scales: build a heatmap with conditional formatting
Turn a table into a heatmap: 2- and 3-color scales, choosing the right color direction, the outlier trap and fixing it with a percentile.
A color scale is conditional formatting that colors each cell according to its value. The largest value gets one color (say, green), the smallest another (red), and everything in between a blend of the two. The result is a heatmap.
Color scales shine in tables with many columns: branches × months, products × regions, students × subjects. Without reading a single number you see where things are good and where they are bad.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 120 | 135 | 150 | |
| 3 | Samarkand | 80 | 72 | 95 | |
| 4 | Bukhara | 45 | 60 | 58 | |
| 5 | Namangan | 66 | 70 | 88 | |
| 6 | Andijan | 52 | 49 | 77 | |
| 7 |
Adding a color scale — 4 steps
1
Select all number cells as one range: B2:D6. Leave out headers and any total row.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 120 | 135 | 150 | |
| 3 | Samarkand | 80 | 72 | 95 | |
| 4 | Bukhara | 45 | 60 | 58 | |
| 5 | Namangan | 66 | 70 | 88 | |
| 6 | Andijan | 52 | 49 | 77 | |
| 7 |
2
Главная → Условное форматирование → Color Scales.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 120 | 135 | 150 | |
| 3 | Samarkand | 80 | 72 | 95 | |
| 4 | Bukhara | 45 | 60 | 58 | |
| 5 | Namangan | 66 | 70 | 88 | |
| 6 | Andijan | 52 | 49 | 77 | |
| 7 |
3
Pick a scale. The first row holds 3-color scales, the second 2-color ones. For sales, Green - Yellow - Red Color Scale fits: high is green, low is red.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 120 | 135 | 150 | |
| 3 | Samarkand | 80 | 72 | 95 | |
| 4 | Bukhara | 45 | 60 | 58 | |
| 5 | Namangan | 66 | 70 | 88 | |
| 6 | Andijan | 52 | 49 | 77 | |
| 7 |
4
Done: the largest number (150) is dark green, the smallest (45) is red, and the middle value (the median, 72) is yellow. Change the numbers and the colors follow.
2-color vs 3-color scales
- A 2-color scale: the minimum gets one color, the maximum another, with a smooth blend in between. Great for showing the “strength” of a single metric (white to green).
- A 3-color scale: minimum, midpoint and maximum. The midpoint defaults to the 50th percentile — the median: half the values are above it, half below. Great for “good / average / bad”.
Important: colors are relative to the selected range. A red 45 doesn’t mean 45 is bad — only that it is the smallest value in this table.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Score | ||
| 2 | Aziz | 92 | ||
| 3 | Dilnoza | 78 | ||
| 4 | Javohir | 55 | ||
| 5 | Malika | 88 | ||
| 6 | Sardor | 64 | ||
| 7 | Nodira | 71 | ||
| 8 |
Pick the right color direction
Green reads as “good”, red as “bad”. For sales and profit, high is good, so use Green - Yellow - Red. For expenses, delays, returns and defects it’s the opposite — high is bad. There, choose Red - Yellow - Green, or your table will mislead: the branch with the highest costs shows up “green” and looks like it deserves praise.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Jan | Feb | Mar | |
| 2 | Tashkent | 38 | 41 | 44 | |
| 3 | Samarkand | 22 | 25 | 21 | |
| 4 | Bukhara | 15 | 18 | 17 | |
| 5 | Namangan | 19 | 20 | 26 | |
| 6 | Andijan | 16 | 14 | 23 | |
| 7 |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Shop | Sales | With percentile 80 | |
| 2 | Chilanzar | 120 | 120 | |
| 3 | Yunusabad | 135 | 135 | |
| 4 | Sergeli | 95 | 95 | |
| 5 | Almazar | 9001 | 900 | |
| 6 | Yashnabad | 88 | 88 | |
| 7 | Mirabad | 110 | 110 | |
| 8 |
Pro level: minimum, midpoint and maximum types
In the Edit Formatting Rule dialog each point has a type:
- Lowest / Highest Value — the smallest/largest value in the range (default).
- Number — a fixed value. If the pass mark is 56, set the midpoint to Number = 56: everything below leans red, above leans green, and it means the same thing in every group’s table.
- Percent — a share between minimum and maximum (0–100).
- Percentile — rank-based, resistant to outliers.
- Formula — take the threshold from a formula, e.g.
=СРЗНАЧ($B$2:$D$6)or a target in another cell.
One more subtlety: if you apply the scale to each column separately (or copy it column by column with Format Painter), each column gets its own minimum and maximum. Months can no longer be compared — each has “its own red”. Use one rule for the whole table.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Shop | Sales | ||
| 2 | Chilanzar | 120 | ||
| 3 | Yunusabad | 135 | ||
| 4 | Sergeli | 95 | ||
| 5 | Almazar | 900 | ||
| 6 | Yashnabad | 88 | ||
| 7 | Mirabad | 110 | ||
| 8 |
Try it in the simulator
Work out in advance which value a 3-color scale paints yellow: type =МИН(B2:D6) in B8, =МЕДИАНА(B2:D6) in C8 and =МАКС(B2:D6) in D8. The median (72) is exactly the value that turns yellow.
| 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 | Branch | Jan | Feb | Mar | ||||||||||||||||||||
| 2 | Tashkent | 120 | 135 | 150 | ||||||||||||||||||||
| 3 | Samarkand | 80 | 72 | 95 | ||||||||||||||||||||
| 4 | Bukhara | 45 | 60 | 58 | ||||||||||||||||||||
| 5 | Namangan | 66 | 70 | 88 | ||||||||||||||||||||
| 6 | Andijan | 52 | 49 | 77 | ||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | Min / Med / Max | |||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.