Excel tutorial
/

Data analysis

Intermediate

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.

Книга1 - Excel
—☐✕
fx
ABCDE
1BranchJanFebMar
2Tashkent120135150
3Samarkand807295
4Bukhara456058
5Namangan667088
6Andijan524977
7
Готово
Sales, mln UZS. 3-color scale: Tashkent is in the green zone, Bukhara and Andijan are red in January–February

Adding a color scale — 4 steps

1

Select all number cells as one range: B2:D6. Leave out headers and any total row.

Книга1 - Excel
—☐✕
B2fx120
ABCDE
1BranchJanFebMar
2Tashkent120135150
3Samarkand807295
4Bukhara456058
5Namangan667088
6Andijan524977
7
ГотовоСреднее: 81,1333Количество: 15Сумма: 1217

2

Главная → Условное форматирование → Color Scales.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить
Буфер обмена
Calibri ▾11 ▾
Шрифт
Выравнивание
Общий ▾
Число
Условное форматированиеФорматировать как таблицуСтили ячеек
Стили
ВставитьУдалитьФормат
Ячейки
АвтосуммаСортировка и фильтрНайти и выделить
Редактирование
B2fx120
ABCDE
1BranchJanFebMar
2Tashkent120135150
3Samarkand807295
4Bukhara456058
5Namangan667088
6Andijan524977
7
ГотовоСреднее: 81,1333Количество: 15Сумма: 1217

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.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить
Буфер обмена
Calibri ▾11 ▾
Шрифт
Выравнивание
Общий ▾
Число
Условное форматированиеФорматировать как таблицуСтили ячеек
Стили
ВставитьУдалитьФормат
Ячейки
АвтосуммаСортировка и фильтрНайти и выделить
Редактирование
B2fx120
ABCDE
1BranchJanFebMar
2Tashkent120135150
3Samarkand807295
4Bukhara456058
5Namangan667088
6Andijan524977
7
ГотовоСреднее: 81,1333Количество: 15Сумма: 1217
The Color Scales gallery (names appear when you hover over an icon)

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.

Книга1 - Excel
—☐✕
fx
ABCD
1StudentScore
2Aziz92
3Dilnoza78
4Javohir55
5Malika88
6Sardor64
7Nodira71
8
Готово
2-color scale (White - Green): the lowest score is white, the highest is dark green

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.

Книга1 - Excel
—☐✕
fx
ABCDE
1BranchJanFebMar
2Tashkent384144
3Samarkand222521
4Bukhara151817
5Namangan192026
6Andijan161423
7
Готово
Expenses, mln UZS — Red - Yellow - Green: high costs are red, low costs green
Книга1 - Excel
—☐✕
fx
ABCD
1ShopSalesWith percentile 80
2Chilanzar120120
3Yunusabad135135
4Sergeli9595
5Almazar9001900
6Yashnabad8888
7Mirabad110110
8
Готово
B: default scale — everything except 900 is white. C: Maximum = Percentile 80 — the differences are visible again

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.

Книга1 - Excel
—☐✕
B2fx120
ABCD
1ShopSales
2Chilanzar120
3Yunusabad135
4Sergeli95
5Almazar900
6Yashnabad88
7Mirabad110
8
ГотовоСреднее: 241,3333Количество: 6Сумма: 1448
Switching the maximum type to Percentile = 80

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.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1BranchJanFebMar
2Tashkent120135150
3Samarkand807295
4Bukhara456058
5Namangan667088
6Andijan524977
7
8Min / Med / Max
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

50 / 154