Peltier Technical Services, Inc.
 

Excel Chart Add-Ins | Training | Charts and Tutorials | Peltier Tech Blog


Peltier Tech Chart Utilities for Excel Peltier Tech Panel Chart Utility Peltier Tech Waterfall Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

 

Excel Dashboards

 

Books at Amazon.com

 

Excel Column Combination Chart for Monthly Temperatures.


 

In Column Combination Chart for Monthly Temperatures, I showed how to create a stacked column chart which summarized the past month's temperatures. It's an informative chart, and compares each day's minimum and maximum temperature with the normal range and the historical minimum and maximum temperatures for each date. Jack Jordan sent along a data set that didn't work using the protocol in that web page. Jack's temperatures were lower and stated in Celcius, so the data ranges that feed the chart had to be changed following the procedures in Stacked Column Charts that Cross the X Axis.

The chart looks pretty complicated, but it can be broken down into smaller components:

The Data

The important daily temperature data supplied by Jack is shown below.

  A B C D E F G
4 Date Record Low Record High Normal Low Normal High Daily Low Daily High
5 1-Oct -0.6 28.3 6.7 17.2 3.4 14.9
6 2-Oct 0 26.1 7.0 16.6 2.8 23.5
7 3-Oct -2.8 27.2 6.6 15.9 11.9 20.4
8 4-Oct -0.9 27.6 6.3 15.5 8.5 17
9 5-Oct -1.1 27.5 5.4 14.5 1.3 10.5
10 6-Oct -4.4 26.6 5.6 15.0 -1.6 10.6
11 7-Oct -1.7 23.9 5.8 14.2 0.8 16.2
12 8-Oct -4 25.6 6.1 14.9 6 19.9
13 9-Oct -2.1 25.6 5.9 14.3 10 15.9
14 10-Oct -2.8 27.8 5.1 14.0 8.8 11.8
15 11-Oct -5 25 4.9 14.6 7.4 17.5
16 12-Oct -1.8 25 4.9 14.2 -0.6 7.7
17 13-Oct -3.9 25.7 4.3 14.6 0.5 5.9
18 14-Oct -2.4 25 5.3 14.0 2.1 7.5
19 15-Oct -3.4 26.1 4.9 13.7 3.8 9.6
20 16-Oct -4.5 26.7 4.5 13.4 1.8 13.5
21 17-Oct -6.1 25 4.0 13.0 8.2 12.2
22 18-Oct -3.9 25 3.8 12.8 10.2 14
23 19-Oct -5.6 23.3 3.0 11.6 4.8 13.6
24 20-Oct -3.9 23.9 2.8 11.6 3.1 6.1
25 21-Oct -3.1 23.3 3.6 11.8 2.4 9.4
26 22-Oct -3.3 22.2 3.6 11.7 4 10
27 23-Oct -4.5 24.4 4.2 12.1 1.8 4.1
28 24-Oct -4.4 24.4 3.5 11.2 1.2 5.3
29 25-Oct -4.6 23.3 2.9 11.2 1.7 5.1
30 26-Oct -3.9 20 3.1 11.1 -2.6 7.7
31 27-Oct -3.3 20.3 2.9 11.0 0.3 6.5
32 28-Oct -7.2 21.1 2.4 10.7 1 4.9
33 29-Oct -7.2 21.5 1.9 10.0 2.1 6
34 30-Oct -6.7 23.3 2.6 11.2 0.5 14
35 31-Oct -5 22.2 3.0 11.1 4.6 16

In order to generate floating and stacked columns, we need to make adjustments to the data. The new data for the Record High/Low and Normal Range series must include a hidden series on which the others float (using the Record Low value), a series containing the difference between Normal Low and Record Low, a series containing the Normal Range (the difference between Normal High and Normal Low), and a series containing the difference between Record High and Normal High. The new data for the Daily Range needs a hidden series (the Daily Low) and a series showing the Daily Range (the difference between Daily High and Daily Low). The circles around the month's High and Low require two more series that only have plottable data for the actual high and low data points. The transformed data is shown here:

  H I J K L M N O P Q R
4 Top- Above- Normal- Below- Bottom+ Below+ Normal+ Above+ Range Monthly Low -3°C Monthly High 24°C
5 0.0 0.0 0.0 -0.6 0 6.7 10.5 11.1 12 #N/A #N/A
6 0.0 0.0 0.0 0.0 0 7.0 9.6 9.5 21 #N/A 23.5
7 0.0 0.0 0.0 -2.8 0 6.6 9.3 11.4 9 #N/A #N/A
8 0.0 0.0 0.0 -0.9 0 6.3 9.1 12.1 9 #N/A #N/A
9 0.0 0.0 0.0 -1.1 0 5.4 9.1 13.0 9 #N/A #N/A
10 0.0 0.0 0.0 -4.4 0 5.6 9.5 11.6 12 #N/A #N/A
11 0.0 0.0 0.0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 8.5 12.1 14 #N/A #N/A
35 0.0 0.0 0.0 -5.0 0 3.0 8.1 11.1 11 #N/A #N/A

The formulas required to construct this range are summarized below. The formulas in H5:R5 are filled down to H35:R35.

Column Name

Cell Range

Formula in Top Cell of Range

Top-

H5:H35

=IF(C5<0,C5,0)

Above-

I5:I35

=IF(E5<0,IF(C5<0,E5-C5,E5),0)

Normal-

J5:J35

=IF(D5<0,IF(E5<0,D5-E5,D5),0)

Below-

K5:K35

=IF(B5<0,IF(D5<0,B5-D5,B5),0)

Bottom+

L5:L35

=IF(B5>0,B5,0)

Below+

M5:M35

=IF(D5>0,IF(B5>0,D5-B5,D5),0)

Normal+

N5:N35

=IF(E5>0,IF(D5>0,E5-D5,E5),0)

Above+

O5:O35

=IF(C5>0,IF(E5>0,C5-E5,C5),0)

Range

P5:P35

=G5-F5

Monthly Low

Q4 only

="Monthly Low "&TEXT(MIN($F$5:$F$35),"0°C")

Q5:Q35

=IF(F5=MIN(F$5:F$35),F5,NA())

Monthly High

R4 only

="Monthly High "&TEXT(MAX($G$5:$G$35),"0°C")

R5:R35

=IF(G5=MAX(G$5:G$35),G5,NA())

The formulas in Q4 and R4 concatenate the label and value; these will become the series names, and the series will be labeled using the Series Name option. The formulas in columns Q and R below these labels assure that only the maximum and minimum will appear in the chart; NA() produces an ugly #N/A error in the sheet, but a Line or XY chart ignores this when plotting points.

Finally, we need special data for the series which will be used for the labels along the right edge of the chart. The range is shown below, along with the formulas which define these values.

  T U V
4   Record  
5 31-Oct -5 Record Low
6 31-Oct 22.2 Record High
7 31-Oct 7.1 Normal Range
8   7.1  
9 #N/A 3.0 Normal Low
10 #N/A 11.1 Normal High
11      
12   Daily Range  
13 31-Oct 10.3  
14   10.3  
15   4.6 Daily Low
16   16 Daily High
17      
18   -7.2 Record Low
19   28.3 Record High
20   12 Divisor

Cell(s)

Formula

T5

=MAX($A$5:$A$35)

T6:T7

=$T$5

U5

=VLOOKUP($T$5,$A$5:$G$35,2)

U6

=VLOOKUP($T$5,$A$5:$G$35,3)

U7

=IF(ABS(U8-U14)>(U19-U18)/U20,Q8,(U8+U14)/2+IF(U8>U14,(U19-U18)/(2*U20),-(U19-U18)/(2*U20)))

U8

=(U9+U10)/2

U9

=VLOOKUP($T$5,$A$5:$G$35,4)

U10

=VLOOKUP($T$5,$A$5:$G$35,5)

T13

=$T$5

U13

=IF(ABS(U8-U14)>(U19-U18)/U20,U14,(U8+U14)/2+IF(U8>U14,-(U19-U18)/(2*U20),(U19-U18)/(2*U20)))

U14

=(U15+U16)/2

U15

=VLOOKUP($P$5,$A$5:$G$35,6)

U16

=VLOOKUP($P$5,$A$5:$G$35,7)

U18

=MIN($B$5:$B$35)

U19

=MAX($C$5:$C$35)

U20

Factor selected to move labels appropriate amount only if necessary

The lookup formulas in column U are more intricate than necessary (as are those in column T), but they allow rapid scaling up if the data were converted to a dynamic range. They determine the latest value of each of the relevant series, for proper vertical alignment of the labels.

The uncorrected label positions in U8 and U14 in the original version of this page may cause the "Normal Range" and "Daily Range" labels to overlap. The complicated formulas in U7 and U13 and the factor in U20 allow for moving of these labels if they would overlap on the chart.

Making the Chart

The first step is to make a stacked column chart from the historical data. Select A4:A35 (Date), then hold Ctrl while selecting H4:O35 (Top-, Above-, Normal-, Below-, Bottom+, Below+, Normal+, and Above+). Start the chart wizard, and create a Stacked Column chart. (Don't make a Stacked 100% Column chart.)

The chart has my usual plot area formatting: black border, white fill, and light gray gridlines.

Make the Bottom series invisible: double click on the series, and on the Patterns tab of the Format Series dialog, choose None for Area and for Border. Double click on the Below series and choose light gray for Area and None for Border; on the Options tab, reduce the Gap Width to 50 to widen the columns. Format the Above series the same, by selecting it and pressing the F4 function key (the shortcut for Repeat Last Action). Format the Normal series with a medium gray for Area and None for Border. Other adjustments at this point included deleting the legend, moving the axis tick labels to the Low position, and formatting the X axis major spacing to 7 days.

Note: for my light gray color, I used a custom color in the Excel color palette. I went to the Tools menu > Options > Color tab, clicked on the "dark yellow" square (the greenish-brown square, third from the left in the second row), clicked on Modify, and selected the third lightest gray on the custom color tab. I used the lightest gray on Excel's palette (just above the white square) as my medium gray color.

Now the Daily High and Low data is added to the chart. Select F4:G35 (Daily Low and High), and copy (Ctrl+C or Copy from the Edit menu). Select the chart, and choose Paste Special from the Edit menu. Choose New Series, Values in Columns, and Series Names in First Row. These two series are added as two more stacked column series on top of the nicely formatted gray series showing the historical norms and extremes.

Change the two new series to Line types. Select one of these new series, and on the Chart menu, choose Chart Type, and select Line Chart in the left list, and any of the subtypes on the right. Select the other new series, and repeat (use the F4 function key as a shortcut for Repeat Last Action).

Add the up-down bars. Double click one of these new line series, and on the Options tab, check the Up-Down Bars box. Decrease the number in the Gap Width box if you want thicker up-down bars (I kept this at 150).

Format the line series and the up-down bars. Double click one series, and on the Patterns tab, choose None for Line and None for Markers. Select the other line series, and repeat (use the F4 function key as a shortcut for Repeat Last Action). Double click the up-down bars and on the Patterns tab choose appropriate settings for Area color (Orange) and Border (None).

Add the series which will indicate the month's minimum and maximum temperatures. Copy Q4:R35 (Monthly Low and Monthly High), select the chart, and choose Paste Special from the Edit menu. Choose New Series, Values in Columns, and Series Names in First Row. These become two more line series, and (temporarily) mess up the nice up-down bars.

Change the two new series to XY types. Select one of these new series, and on the Chart menu, choose Chart Type, and select XY (Scatter) Chart in the left list, and the Scatter subtype (markers without lines) on the right. Select the other new series, and repeat (use the F4 function key as a shortcut for Repeat Last Action). Notice that the up-down bars have returned, and Excel has added secondary X and Y axes to the chart.

Move these new series to the primary axis. Double click one of the new series, and on the Axis tab, select the Primary option. Select the other new series, and repeat (use the F4 function key as a shortcut for Repeat Last Action). The new markers now line up with the highest and lowest ends of the up-down bars.

Format the Monthly High and Low series. Double click on one of the series; on the Patterns tab of the Format Series dialog, select None for Line and a large (size 7) circle with black (for example) as its Foreground and No Color for its Background; on the Data Labels tab, check the Series Name option. Select the other line series and press the F4 function key. Double click on the Monthly High data label, and on the Alignment tab, choose Above for Label Position. Double click on the Monthly Low data label, and on the Alignment tab, choose Below for Label Position.

Add the series that will locate the descriptive labels. Copy T4:U7 (Record, highlighted in blue), select the chart, and choose Paste Special from the Edit menu. Choose New Series, Values in Columns, Series Names in First Row, and Categories (X Labels) in First Column. Copy T12:U13 (Daily Range, highlighted in green), select the chart, and choose Paste Special from the Edit menu. Choose New Series, Values in Columns, Series Names in First Row, and Categories (X Labels) in First Column. Since the last series was converted to an XY series, these series are added as XY series; Record is shown in blue and Daily Range in green.

Add labels to the new XY series. Select the Daily Range series, and on the Data Labels tab, select the Series Name option; on the Patterns tab, select None for Line and Markers. For the Record series, there are three choices:

  • Add Series Name labels as above, then manually change the text of each label to the text you want.
  • Add Series Name labels, then link the labels to the cells as follows: select an individual label (denoted by a gray rectangle around the label, which may take two clicks), then type = in the Formula Bar, and click on the cell with the mouse. This produces a link like =Sheet1!$R$7 which forces the label to update when the cell updates.
  • Download Rob Bovey's Chart Labeler from http://appspro.com or John Walkenbach's Chart Tools from http://j-walk.com. Both are free Excel add-ins, easy to install and use. These add-ins allow you to apply linked cell values to the data labels of a chart series, in a much less tedious way than above.

Hide the series and format the labels. To hide the series, double click on each and on the Patterns tab choose None for Line and None for Markers. I've used orange and gray font colors so the labels are more clearly associated with the historical series in the chart.


Area Combination Chart for Monthly Temperatures is an alternative version of this chart that uses areas rather than columns to display the temperature data.

 

 

Page copy protected against web site content infringement by Copyscape

 

Peltier Tech Chart Utilities for Excel Peltier Tech Waterfall Chart Utility Peltier Tech Box and Whisker Chart Utility Peltier Tech Cluster-Stack Chart Utility Peltier Tech Panel Chart Utility Peltier Tech Marimekko Chart Utility Peltier Tech Dot Plot Utility Peltier Tech Cascade Chart Utility

 

Create Excel dashboards quickly with Plug-N-Play reports.


Peltier Technical Services, Inc.

Excel Chart Add-Ins | Training | Charts and Tutorials | PTS Blog

Peltier Technical Services, Inc., Copyright © 2011. All rights reserved.
You may link to this article or portions of it on your site, but copying is prohibited without permission of Peltier Technical Services.

Microsoft Most Valuable Professional

Microsoft Most Valuable Professional

My MVP Profile