Return to Contents
The three charts in this worksheet show three ways to handle missing data.
In the first chart the missing data is not plotted, in the second the missing
data is plotted as zeros, and in the third Excel interpolates the missing data.
The Data
Time Temperature
12:00 AM
28
1:00 AM
2:00 AM
27
27
60
3:00 AM
4:00 AM
24
26
40
5:00 AM
6:00 AM
32
35
20
7:00 AM
8:00 AM
38
40
9:00 AM
10:00 AM
45
11:00 AM
12:00 PM
1:00 PM
47
50
52
2:00 PM
3:00 PM
52
50
4:00 PM
5:00 PM
43
6:00 PM
7:00 PM
36
34
8:00 PM
9:00 PM
32
30
10:00 PM
29
11:00 PM
28
Temperature
Chart 1 - Missing Data Not Plotted
50
30
10
0
60
Temperature
Chart 2 - Missing Data Not Plotted as Zeros
50
40
30
20
10
0
60
50
40
30
20
10
0
Temperature
Chart 3 - Missing Data Interpolated
Return to Contents
Chart 1: A column chart using data in Data Range 1 with the quarterly sales values as
the data series and the regions as the categories. Change the Q1 Sales series name from
"Q1 Sales" to "Quarter 1 (Millions"). The plotting order is changed so the quarter 2 series
markers appear to the left of the quarter 1 series markers and "Q2 Sales" is the top row.
of the legend.
Chart 2: A copy of Chart 1 with these changes:
1) All series removed but North, South, East, and West.
2) North, South, East, and West data added for quarters 3 and 4 from Data Range 2.
3) Y-axis scale chaned from $0 to $70 to $0 to $80 and display labels by 20s on the axis
(that is, $0, $20, $40, $60, $80, and $100) instead of by 10s.
4) A chart data table added.
Data Range 1
Region
North
South
East
West
Central
NorthWest
NorthEast
SouthWest
Q1 Sales
$50
$45
$32
$58
$40
$35
$30
$38
Q2 Sales
$55
$42
$35
$50
$43
$35
$28
$45
SouthEast
$42
$48
Region
North
South
East
West
Central
NorthWest
NorthEast
SouthWest
Q3 Sales
$58
$41
$37
$49
$46
$37
$24
$47
Q4 Sales
$56
$40
$38
$52
$47
$34
$22
$48
SouthEast
$48
$45
Chart 1
$70
Q2 Sales
$60
Quarter 1 (Millions)
$50
$40
$30
$20
$10
$0
Data Range 2
Nor th
South
East
West
Centr al
Nor thWest
Nor thEast
SouthWest
Chart 2
$80
$60
$40
$20
$0
Nor th
South
Q2 Sales
East
Quarter 1 (M illions)
West
Q3 Sales
Q4 Sales
SouthEast
Return to Contents
The data for the chart doesn't exist anywhere but in the SERIES
statement, which is =SERIES(,{"Films","Books","Music"},{2, 9, 7},1).
Hours Per Week: Entertainment
The copy of the chart below has been modified to column from pie.
The SERIES formula has been changed so that Films, Books, and
Music constitute a single data marker with a total of 18 hours and Laundry,
Cooking, and Dusting are a second data marker with a total of 6 hours.
A legend has been included and functions as this chart's title.
Below is the text for the series function that will create this second chart.
=SERIES("Hours Per Week: Entertainment vs. Housekeeping",{"Films, Books & Music","Laundry, Cooking, & Cleaning"},{18,6},1)
When displaying the formula in the worksheet, precede the formula with
a single quote mark so Excel doesn't attempt to interpret the text as an
actual formula.
10
* Note
To create a chart using only a series formula, start the Chart Wizard
Wizard as usual but without selecting any data beforehand. In the
Wizard's Step 1 select a chart type. Click the Wizard's Finish
button immediately. With the empty rectangle the Wizard has
allocated selected (Illustr. 1), click in Excel's Formula Bar enter the
series function that defines your chart. Excel creates the basic
chart (Illustr. 2). Add whatever formatting you like.
Illustr. 1
Illustr. 2
Combination Charts
Return to Cont
$43
$46
$49
$80
$80
$60
$60
$40
$40
$20
$20
$0
$0
North
Q4 Sales
South
East
Q1 Sales
West
Q2 Sales
Central
Q3 Sales
North
Q3 Sales
Excel offers a few built-in combination charts on its Chart Wizard Step 1
on its "Custom Types" tab, but it's easy to customize your own combination.
South
East
Q4 Sales
West
Q1 Sales
Centra
Q2 Sale
Return to Contents
Combination Chart
st
West
Q1 Sales
Central
Q2 Sales
March
April
May
June
July
August
September
$3,400,000
$2,550,000
$1,700,000
Income
$850,000
Profit Margin
$March
April
May
June
July
August
September
15.0%
14.0%
$2,270,000
Income
$1,570,000
12.0%
11.0%
$870,000
Income
Profit Margin
$170,000
M arch
April
M ay
June
July
August
10.0%
9.0%
September
Profit Margin
13.0%
Income
$1,570,000
12.0%
11.0%
$870,000
Income
Profit Margin
$170,000
M arch
April
M ay
June
July
August
10.0%
9.0%
September
Profit Margin
13.0%
$
$
$
$
$
$
Income
2,455,682
2,022,515
1,899,588
2,450,385
2,885,626
1,993,285
Profit Margin
12.5%
11.2%
10.1%
14.5%
14.1%
13.2%
1,988,659
10.9%
15.0%
14.0%
12.0%
11.0%
10.0%
9.0%
tember
Profit Margin
13.0%
Return to Contents
12.0%
11.0%
10.0%
9.0%
tember
Profit Margin
13.0%
$2,500,000
10.0%
$2,000,000
$3,000,001
$2,500,001
8.0%
$1,500,000
6.0%
$1,000,000
4.0%
$500,000
2.0%
$-
$2,000,001
$1,500,001
$1,000,001
0.0%
March
April
May
$500,001
$1
March
Quarter1
Quarter2
Apri
Quarter3
Chart Data
Apr
Feb
Mar
Jun
May
Apr
Mar
Feb
January
10
Return to Contents
rea with Graphical Fill and Chart Series with Graphical Fill
$3,000,001
$2,500,001
$2,000,001
$1,500,001
$1,000,001
$500,001
$1
March
April
May
Quarter 1
Quarter 2
Quarter 3
New Data
Old Data
10
20
30
40
50
60
Feb
Mar
Q1
104
115
Q2
Q3
75
86
56
44
80
40
0
Q1
Q2
Q3
Return to Contents
uthern Region
Data
12
10
8
6
4
2
0
500
1000
1500
2000
Year (plotted against population figures)
12
10
8
6
4
2
0
2500
Year
0
1000
1250
1500
1750
1800
1850
1900
1910
1920
1930
1940
1950
1960
1970
1980
1990
1999
2000
2010
2020
2030
2040
2050
2100
2150
Data
Population
0.01
0.20
0.40
0.65
0.78
0.90
1.20
1.65
1.75
1.85
1.95
2.05
2.59
2.70
3.10
3.80
4.30
4.85
5.40
5.95
6.50
8.11
8.58
8.91
9.46
9.75
(billions)
Return to Contents
Good
Very Good
Excellent
0.0% 5.0% 10.0% 15.0% 20.0% 25.0% 30.0% 35.0% 40.0% 45.0%
Unsatisfactory
Not Good
Good
Very Good
Excellent
0.0% 2.0% 4.0% 6.0% 8.0% 10.0% 12.0% 14.0% 16.0% 18.0%
This third chart is based on fewer responses. The scale of this chart matches the scale
of the first chart, making it easier to compare responses accurately across charts.
Survey Question 2 Responses (Scale 0-50%)
Unsatisfactory
Not Good
Good
Unsatisfactory
Not Good
Good
Very Good
Excellent
0.0%
10.0%
20.0%
30.0%
40.0%
50.0%
Return to Contents
Sales (Thousands)
$0.0
$1.0
$2.0
$3.0
$4.0
$5.0
$6.0
$7.0
If you prefer you can turn off this Excel charting feature. Open the
"Chart Options" dialog for the chart and on the "Axes" tab change
the selected option for the category axis from "Automatic" to "Category".
Sales (Thousands)
10/28/2003
10/24/2003
10/23/2003
10/18/2003
10/12/2003
10/7/2003
Sale Date
10/5/2003
10/7/2003
10/12/2003
10/18/2003
10/23/2003
10/24/2003
10/28/2003
10/24/2003
10/23/2003
10/18/2003
10/12/2003
10/7/2003
10/5/2003
$0.0
$1.0
$2.0
$3.0
$4.0
$5.0
$6.0
$7.0
Sales (Thousands)
$5.3
$4.5
$6.6
$5.8
$3.2
$5.1
$4.8
Return to Contents
Month
Contacts
25
20
15
10
China
Japan
Far East
Croatia
Russia
Eastern Europe
Canada
Mexico
West
To correct Excel's interpretation of the data, use the "Series" tab in the
"Source Data" chart dialog. Note that data used for the multiple category
names must be contiguous.
20
15
10
10
11
China
Japan
Far East
10
11
Croatia
Russia
Eastern Europe
10
11
Canada
Mexico
West
Number of Conta
10
10
11
China
Japan
Far East
10
11
Croatia
Russia
Eastern Europe
10
11
Canada
Mexico
West
Category Labels
Region
Far East
Countries
China
Japan
Eastern Europe Croatia
Russia
West
Canada
Mexico
Month
10
11
10
11
10
11
Data to Chart
Contacts
15
16
12
10
18
23
Return to Contents
-2
-4
-6
Data to Chart
-5
-3
-1
3
5
8
-2
-4
-6
1
Return to Contents
20
Demand
16
15
12
12
10
8
8
5
4
0
$20
$25
$30
$35
$40
$45
Price
* See http://support.microsoft.com/default.aspx?scid=kb;en-us;213750
SUMMARY
Excel has no built-in commandto automatically attach text labels to
data points in an xy (scatter) or Bubble chart. However, you can create a
Visual Basic for Applications macro that does this. Below is a macro that
performs this task on an XY Scatter chart. It can also be used for a Bubble Chart.
The sample code in this article assumes that the data and associated labels
are arranged in a worksheet according to the following format: The first
column contains the data labels. The second column contains the x values
for the xy (scatter) chart. The third and subsequent columns contain the y
values for the xy (scatter) chart.
NOTE: Although the example provided contains only one column of data for
y values, you can use more than one series of data.
To use the macro described here, create a chart using the following data:
A1:
A2:
A3:
A4:
A5:
A6:
Labels
DataPoint1
DataPoint2
DataPoint3
DataPoint4
DataPoint5
B1: X Values
B2: 12
B3: 9
B4: 5
B5: 4
B6: 1
C1: Y Values
C2: 5
C3: 7
C4: 3
C5: 8
C6: 4
NOTE: The table should not contain empty columns, and the column that contains the
data labels should not be separated from the column that contains the x values. The
labels and values must be laid out in exactly the format described in this article
(the location of the upper-left cell does not have to be cell A1).
To attach text labels to data points in an xy (scatter) chart, follow these steps:
- Create an XY chart in the usual fashion.
- Press ALT+F11 to open Excel's Visual Basic for Applications environment.
- On the VBA Insert menu, click Module to create a code window.
- Type the following sample code in the module sheet (or copy & paste from here):
Sub AttachLabelsToPoints()
'Dimension variables.
Dim Counter As Integer, ChartName As String, xVals As String
' Disable screen updating while the subroutine is run.
Application.ScreenUpdating = False
'Store the formula for the first series in "xVals".
xVals = ActiveChart.SeriesCollection(1).Formula
'Extract the range for the data from xVals.
xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, _
Mid(Left(xVals, InStr(xVals, "!") - 1), 9)))
xVals = Left(xVals, InStr(InStr(xVals, "!"), xVals, ",") - 1)
Do While Left(xVals, 1) = ","
xVals = Mid(xVals, 2)
Loop
'Attach a label to each data point in the chart.
For Counter = 1 To Range(xVals).Cells.Count
ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _
Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
Next Counter
End Sub
Netsuke
Kirin
Badger
Foo Dog
Bean Thrower
Mirror Polisher
Price
$22
$38
$32
$42
$28
Demand
8
12
10
5
15
Bubble Size**
Availability
3
5
4
1
8
Return to Contents
Demand
16
12
$45
ubble Chart.
4
$15
$20
$25
$30
Price
$35
$40
** This column of data is used in the bubble chart only. The bubble size
gives a quick visual indication of the "availability" dimension in the data.
$45
nvironment.
",") - 1)
sDataLabel = _
ataLabel.Text = _
hLabelsToPoints,
Kirin
Badger
Foo Dog
Bean Thrower
Mirror Polisher
Chart Data
Year
2000
2001
2002
6,000
4,500
Labrador
Corgi
Bedlington
3,000
1,500
2000
2001
2002
View 4: The 3-D chart with a Z Value axis added. The data isn't all
visible in this view and with this arrangement of the data.
4,500
3,000
1,500
Bedlington
Corgi
2000
Labrador
2001
2002
View 6: The data series modified so all data is visible; the chart rotated.
3,000
1,500
Labrador
Corgi
2002
Bedlington
2001
2000
Corgi
2002
Bedlington
2001
2000
Return to Contents
Chart Data
Labrador
2,030
4,325
5,112
Corgi Bedlington
524
82
638
104
929
203
4,500
3,000
1,500
2000
2001
200
The "Chart Options" dialog "Axes" tab with all 3 axes selected.
3,000
6,000
2000
B
2001
Corgi
2002
The "Format Data Series" dialog with its "Series Order" tab.
Labrador
Labrador
Corgi
Bedlington
2001
2002
Use the "Chart Options" "3-D View" dialog and its Default
button to return the chart to a standard perspective.
Bedlington
Corgi
2002
Labrador