Charting Primer II
Charting Primer II
Trend Lines
Return to Contents
Add a trend line to certain chart types* to get a
better idea of how data is trending over time. Excel's
trend line is a best fit line for the charted data series.
A chart with a trend line need not have a time or data
category axis, but the trend line assumes that the category
axis values occur in equal intervals. To add a trend line,
select the chart and from Excel's menus choose Chart,
Add Trendline. Complete the "Add Trendline" dialog
that displays. The "Options" tab in this dialog offers
forward and backward forecasting.
5/21/2003 674,300
5/20/2003 896,800 3,000,000
Volume
5/19/2003 502,300 Volume Trend
5/16/2003 648,700 2,500,000
5/15/2003 635,900
5/14/2003 784,100 2,000,000
5/13/2003 856,300
5/12/2003 820,900 1,500,000
5/9/2003 ###
5/8/2003 784,200 1,000,000
5/7/2003 ###
5/6/2003 703,500 500,000
5/5/2003 446,800
5/2/2003 761,200 0
5/1/2003 978,000 2/24/2003 3/24/2003 4/24/2003
4/30/2003 367,300
4/29/2003 580,000
4/28/2003 370,900 Illustr. 4. The same chart as above but with a 20 day forward forecast. Illustr. 5
4/25/2003 329,900 The regression equation for the trend line is displayed on the chart. The "Options" tab selections for this chart.
4/24/2003 699,800
4/23/2003 ### Krispy Kreme Volumes with Trend Line
4/22/2003 473,600 Forcasting 20 Days Forward
4/21/2003 376,800
4/17/2003 666,500 3,500,000
4/16/2003 400,500
4/15/2003 357,000 3,000,000 Volume
Linear (Volume)
4/14/2003 436,200
4/11/2003 504,400 2,500,000
4/10/2003 ###
2,000,000
4/9/2003 566,100
4/8/2003 345,200
1,500,000
4/7/2003 477,800
4/4/2003 462,200
1,000,000
4/3/2003 528,100
4/2/2003 481,700 f(x) = - 276.2499146777x + 11107800.121499
500,000
4/1/2003 537,500
3/31/2003 392,600 0
3/28/2003 317,800 2/24/2003 3/24/2003 4/24/2003
3/27/2003 635,900
3/26/2003 586,100
3/25/2003 514,600
3/24/2003 888,200
3/21/2003 ###
3/20/2003 ###
3/19/2003 ###
3/18/2003 ###
3/17/2003 933,800
3/14/2003 662,300
3/13/2003 647,200
3/12/2003 408,100
3/11/2003 388,900
3/10/2003 670,200
3/7/2003 727,500
3/6/2003 751,700
3/5/2003 542,300
3/4/2003 377,500
3/3/2003 395,500
2/28/2003 448,500
2/27/2003 348,900
2/26/2003 392,100
2/25/2003 788,400
2/24/2003 716,400
Manipulate Chart Series
$30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Illustr. 2. The "Add Trendline" dialog with Moving Average and # periods selected.
Illustr. 3. Moving average line derived from calculations in Cells O8:O28. Illustr. 4. Same as Illustr. 3 but chart type defined as 3-D Line.
Sample Chart with Moving Average Derived 3-D Line Chart w/Moving Average Derived
from Calculations in the Worksheet from Calculations in the Worksheet
$150
$130
Value
$130 Calculation: Moving Average $110
$110 $90
$70
$90
$50
$70
$30
1 2 3
4 5 6
$50 7 8 9
10 11 12
13 14 15
16 17 18
19 20
$30 Calculation: Moving Average Value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Manipulate Chart Series
Illstr. 1. Error bars added with "Percentage" selected as "Error amount". Illustr. 2. The "Format Data Series" dialog with "Y Error Bars" tab.
Definitely untrue 10
Possibly true 23
Fairly true 25
True 18
Absolutely true 9
5 15 25
Illustr. 3. Error bars added with "Fixed Value" selected as "Error amount". Illustr. 4. The "Y Error Bars" tab for the data series.
25
15
5
Absolutely True Fairly true Possibly Not really Definitely
true true true untrue
Illustr. 5. Right-click an error bar to open the "Format Error Bars" dialog.
Manipulate Chart Series
Illustr. Error bars added with "Percentage" selected as "Error amount". Standard deviation calculations added to
the worksheet and used to chart the
Colum error bars.
Line Chart with Error Bars Added nL SD+1 SD-1
from Worksheet Calculations SD+1
SD-1
17 46
60 17 46
55 17 46
50 17 46
45 17 46
40 17 46
35
30
25
20
15
10
5
Absolutely True Fairly true Possibly true Not really Definitely
true true untrue
3 Ways to Chart Missing Data
Stock Chart
Return to Contents
Stock charts require particular values in a specified order.
The sample chart below requireds three sets of values:
High, Low, and Close. The vertical line at each data point
connects the maximum data point in the category with
the minimum data point in the category. The top of
each vertical bar shows the high for that day.
U.S. Dollar - Euro Simple Stock Chart Type: US Dollar vs. Euro
Date High Low Close
5/5/03 0.8923 0.8846 0.8914 0.9
5/6/03 0.8866 0.873 0.8815 Close
0.89
5/7/03 0.8823 0.8742 0.8751
5/8/03 0.8839 0.8687 0.8745 0.88
5/9/03 0.8739 0.8668 0.8721
5/12/03 0.8675 0.8572 0.8623 0.87
5/13/03 0.8719 0.8646 0.8682
5/14/03 0.8716 0.8664 0.8696 0.86
0.9
0.89
0.88
0.86
0.83
5/5/03 5/6/03 5/7/03 5/8/03 5/9/03 5/12/0 5/13/0 5/14/0 5/15/0 5/19/0 5/20/0 5/21/0 5/22/0 5/23/0 5/27/0
3 3 3 3 3 3 3 3 3 3
The time scale axis displays dates in chronological order using specific intervals even if the dates in
the worksheet are not in chronological order and do not fall in these intervals. By default, Excel sets
the time scale data according to the smallest interval between any two dates in the data.
3 Ways to Chart Missing Data
Illustr. 1. Series lines added using the "Format Data Series" dialog. Illustr. 2. Same chart but as a Bar chart type with series lines reformatted.
Stacked Column Chart with Series Lines Stacked Bar Chart with Series Lines
$140
$120 East
$100
$80
South
$60
$40
North
$20
$0
North South East $0 $20 $40 $60 $80 $100 $120 $140
Illustr. 3. Choose the "Options" tab and "Series lines". Illustr. 4. Right-click a series line and choose "Format Series Lines".
A dynamic chart
Expanding Chart
Excel charts are by nature dynamic. That is, if the data on
which the chart is based changes, the chart automatically
changes as well. However, this is not the case if you
add data to a list. Use this technique to create a chart
that automatically expands (or contracts) with the data.
The list used as data for the chart:
Example: A chart that automatically expands (or contracts) Date Sales
when the amount of data to chart changes. That is, you 10/10/03 82
need not use the "Source Data" option to add or delete data. 10/12/03 55
10/14/03 68
10/16/03 74
An Automatically Expanding Chart 10/18/03 65
using List Data 10/20/03 80
12
10
Instructions:
8 1. Create a standard chart, using existing data.
2. Create two named formulas. The formulas will become argum
6
in a SERIES formula. Insert, Name, Define
4 =OFFSET(ExpandingChart!$I$10, 0, 0, COUNTA(ExpandingCha
Insert, Name, Define. Name: Sales. Refers to:
2
=OFFSET(ExpandingChart!$J$10, 0, 0, COUNTA(ExpandingCha
0 3. Use the Source Data option of the chart to m
it refers to the named ranges Date and Sales instead of to th
coded range references currently in place. Precede the nam
either the workbook name or the worksheet name, then an e
point.
4. Test your chart by adding new data to the end of the list or d
data from the end of the list.
Notes:
* Modify the example formulas above to fit your data locati
* Locate your list ranges in the worksheet so no other data
is in the same column. COUNTA counts the data in the n
column. The -1 parameter subtracts the list header fro
count.
* The names you established with the OFFSET formula will n
display in the formula bar's Name Box.
* See Excel's online help for descriptions of the parameters
the OFFSET and COUNTA functions.
Return to Contents
g existing data.
The formulas will become arguments
Name, Define. Name: Date. Refers to:
10, 0, 0, COUNTA(ExpandingChart!$I:$I)-1, 1)
Sales. Refers to:
10, 0, 0, COUNTA(ExpandingChart!$J:$J)-1, 1)
f the chart to modify the existing chart so
Date and Sales instead of to the hard
ently in place. Precede the named range with
the worksheet name, then an exclamation
Instructions:
1. Create a standard chart.
2. Define the names needed to operate the scroll bar.
Cell M4 is assigned the range name "NumberOfMonths".
The Month range is assigned the name "Month" and is defined
by the OFFSET and COUNTA functions (see the "ExpandingChart"
worksheet in this workbook for more information.
The SalesCalls range is assigned the name "SalesCalls" and is defined
by the OFFSET and COUNTA functions.
Both these names exist only as defined in Excel's Define Name dialog so
you won't see them in the formula bar Name Box drop-down.
3. Use the chart's Source Data dialog to replace hard coded range
references with the category labels and values range for the chart.
4. Add a scrollbar to the chart from the Forms Toolbar. Format the
scrollbar with 1 as the minimum value and 12 as the maximum.
Set the incremental change to 1 and enter NumberOfMonths as
as the cell link.
5. Test the spinner control on the chart.
Notes:
* The NumberOfMonths value is used in the OFFSET function
to control the amount of data the chart displays. The scroll
bar control refers to the NumberOfMonths value as its "Cell
link". Enter an initial value in this cell so you can modify the
chart's Source Data ranges for labels and values.
A dynamic chart
Specify the Starting Date and
Return to Contents
Number of Data Points to Chart
This dynamic chart lets the user choose a particular date
from the data and then the number of data points to chart
starting with that date. The date selection mechanism is
a "validated" cell (F11). Click in the cell to make a choice.
The user selects
The list used as data for the chart. what to chart:
VisitDate RepairVisits Start with:
6/2 12 6/2
6/3 10 # of days:
6/4 9 11
6/5 15
6/6 19 Number of Repair Visits using a Chart
6/7 13 that's Dynamic as to Start Date and Number of D
6/8 11
12
6/9 21
6/10 12
10
6/11 10
6/12 15 8
6/13 16
6/14 13 6
6/15 9
6/16 7 4
6/17 14
6/18 18 2
6/19 17
6/20 6 0
Return to Contents
tartAndNumber!$F$11,
NumberOfDays,1)
tartAndNumber!$F$11,
NumberOfDays,1)
500
400
300
200
Oct Nov Dec Jan Feb Mar Apr May Jun Jul
Report
Reporton
onQuarter
Quarter11Sales
Sales
North is Clear Winner
in First Quarter
East
North
South
South East
50
40
30
20
10
0
Jun Jul Aug Sep Oct Nov Dec
70
60
50
Illustr. 4. Chart with transparent data markers. See creation notes at right. 40
30
40
20
0
Jun Jul A ug
R&D Maintenance
40
20
0
Jun Jul Aug
R&D Maintenance