At a glance
Heat maps are visualisations that use a darker colour for higher values and a lighter colour for lower values. The colours can be reversed if lower values are more important.
![Excel screenshot](https://www.cpaaustralia.com.au/-/media/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-1.jpg?h=527&iar=0&w=476&rev=b1926638513140afa9f0c6edd46fc983&hash=9DD0FB2A9197897AE195A96ACA4B8CF5)
In Excel, heat maps are called “Color Scales” and can be found in the Conditional Formatting drop-down on the Home ribbon – see Figure 1.
Even though there are 12 icons there are only four different options – the extra icons allow the selection of standard colours.
- High to low with a 3-colour scale
- High to low with a 2-colour scale
- Low to high with a 3-colour scale
- Low to high with a 2-colour scale
The high to low option means the higher the score the better, for instance, to show sales or profit.
The low to high option means the lower the score the better, for instance, to show costs or a golf score.
A classic heat map uses the 2-colour scale rather than the 3-colour scale. The 3-colour scale heat map may be too colourful to be useful.
Colour blindness
When choosing colours for conditional formats, be aware that colour blindness affects about one in 12 men and about one in 100 women. The most common form of colour blindness affects the recognition of red and green.
This means the typical “green is good/red is bad” colour combination can be difficult for people with colour blindness to see.
Three safe colours for colour blindness are blue, orange and grey.
Worked example
With sales data from 2023–24, the heat map in Figure 2 shows daily sales for the year.
![Excel screenshot](https://www.cpaaustralia.com.au/-/jssmedia/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-2.jpg?mw=768&mh=null&rev=9b4855761a464a9dab5f7e00b741dcc5)
The range B2:AF13 has formulas that returns the sales value for that day. Illegal dates (like 31 June) return a blank cell. A custom format has been applied to hide the values.
The darker the blue, the higher the sales. The white cells represent the lowest sales. The sales data was randomly generated, so there aren’t many patterns in the heat map.
Date-based heat maps are useful for visualising and interpreting seasonal data, as well as for predictable special occasion dates like Christmas, Easter, Mother’s Day and Father’s Day.
The settings for the conditional format on the range B2:AF13 are shown in Figure 3.
![Excel screenshot](https://www.cpaaustralia.com.au/-/jssmedia/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-3.jpg?mw=768&mh=null&rev=74ac0b286c8f4cc6b29d2a9d6a0acacd)
The first rule displays the illegal dates such 31 June as a black cell. The ticked box on the end of the rule means that if the rule is applied, then no further rules are applied.
![Excel screenshot](https://www.cpaaustralia.com.au/-/media/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-4.jpg?h=380&iar=0&w=476&rev=3c75dd8e08394033b808ecc595649918&hash=E9ECF3DBE765FA50CD42F1966359D2FB)
The second rule is the 2-colour scale, which is shown in Figure 4.
Although this data was randomly generated, there are some insights that can be gleaned from it.
In addition to heat maps, there are other types of conditional formatting worth exploring.
Top/Bottom Rules
This formats only the top or bottom-ranked values.
Consider identifying the highest and lowest 12 values to see if there is a pattern in the data.
For example, Figure 5 shows a blue colour applied to the top 12 sales days and orange applied to the bottom 12 sales days.
![Excel screenshot](https://www.cpaaustralia.com.au/-/jssmedia/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-5.jpg?mw=768&mh=null&rev=ba8a78795a9e471880e5794898bc016f)
The darkness of the colour doesn’t vary in this visualisation.
It can now be seen that the top 12 sales days were all on or after 1 October. March and April 2024 accounted for seven of the 12 top sales days.
The lowest 12 sales days were more evenly distributed throughout the year. Fewer colours make this more obvious.
The conditional format settings are shown in Figure 6.
![Excel screenshot](https://www.cpaaustralia.com.au/-/jssmedia/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-6.jpg?mw=768&mh=null&rev=0320572e693b44c6be96e45c6ef99ed8)
![Excel screenshot](https://www.cpaaustralia.com.au/-/media/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-7.jpg?h=340&iar=0&w=476&rev=a1e7d37bf2f94aa6a33a71e578d5ce7c&hash=509F5E47C24C3B82A140A5BDBC3CA4D4)
The “Bottom 12” settings are shown in Figure 7.
Conditional format interaction
Many conditional formats can link to cells on the sheet, so that the conditional format can be adjusted by changing a cell value. Unfortunately, the top and bottom rule dialogs (Figure 7) do not allow for that type of interaction.
Formulas can be used to create an interactive top/bottom conditional format.
Excel has two functions that help with this, called LARGE and SMALL.
These can identify, for example, the 12th largest value in a range and the 12th smallest value in a range. The syntax is straightforward. The first argument is the range to examine. The second argument is the value position number to find.
![Excel screenshot](https://www.cpaaustralia.com.au/-/media/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-8.jpg?h=150&iar=0&w=476&rev=9ab2412c263c410293f4c1c870dc8c9c&hash=B6325ACA1FDA70FAEB5B73F1A32221AF)
Figure 8 shows a section to the right of the grid that has an input cell for the number of items. The two calculation cells identify the 12th highest value and the 12th lowest value.
The formula in cell AK2 is:
=LARGE(B2:AF13,AJ2)
The formula in cell AL2 is:
=SMALL(B2:AF13,AJ2)
These two calculated values can be used with formula-based conditional formats to create an interactive top and bottom format.
To apply the conditional format, follow these steps.
1. Select the range B2:AF13.
2. On the Home ribbon, click the Conditional Formatting drop-down and select New Rule.
![Excel screenshot](https://www.cpaaustralia.com.au/-/media/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-9.jpg?h=340&iar=0&w=476&rev=6248ee249ca9431f83713e85ebffa09d&hash=15023B71D0BA4A0ADDE81F67463EBA32)
3. In the dialog that opens, select the last option in the top section that starts with “Use a formula” – see Figure 9.
4. In the Format values … box, enter the following formula:
=B2>=$AK$2
5. Click the Format button, select the Fill tab, select blue and click OK.
6. Click OK to apply the format.
More than 12 cells will be highlighted in blue. The “illegal” dates like 31 June will also be highlighted. To change them to black, follow the same six steps above but use the following formula in step 4:
=B2=""
Then, in step 5, select black.
Conditional format formula requirements
The formula for the conditional format needs to be created in a certain way to work across the whole range. The formula must return TRUE to apply the format.
The formula must reference the top-left cell of the range (in this case, cell B2), and it must use a relative reference. No $ signs should be used.
The cell to compare to must be a fixed reference as per $AK$2. In Figure 9, the format will be applied based on comparison of each cell’s value to cell AK2.
To apply the bottom 12 rule, follow the same six steps as in the previous section, but use the following formula in step 4:
=B2<=$AL$2
Then, in step 5, choose orange.
Changing cell AJ2 updates the formats – see Figure 10.
![Excel screenshot](https://www.cpaaustralia.com.au/-/jssmedia/project/cpa/intheblack/images/magazine-2024/08-august/2024-08-excel-figure-10.jpg?mw=768&mh=null&rev=4536def097464d78bbce6865e79916fd)
Note: This technique may show more than the number chosen if there is a tie for that position.
Using conditional formats to apply colours can enable insights into the data based on pattern identification.
The companion video and Excel files (Blank and Completed) will go into more detail to demonstrate these techniques.