Excel Guidelines Chapter2
Excel Guidelines Chapter2
PivotTable report
Scatter diagram
Excel offers extensive capabilities for producing tabular and graphical summaries of data. We
stacked bar chart and scatter diagram. We shall demonstrate two of Excel’s most powerful
tools for data analysis: creating charts and creating PivotTable reports.
Car brands
Using the data on new car purchases in Table 2.1 of the book (file: ‘Car brands.CSV’), we
begin by showing how Excel’s COUNTIF function can be used to construct a frequency
distribution. Refer to Figure 2.20 as we describe the steps involved. The formula worksheet
(showing the functions and formulae used) is in the background, and the value worksheet
(showing the results obtained using the functions and formulae) appears in the foreground.
The label ‘Brand’ and the data for the 50 new car purchases are in cells A1:A51. We also
entered the labels ‘Brand purchased’ and ‘Frequency’ in cells C1:D1. The five car brand
names are entered into cells C2:C6. Excel’s COUNTIF function can now be used to count the
number of times each car brand appears in cells A2:A51. The following steps are used.
Step
1 Select cell D2
2 Enter =COUNTIF($A$2:$A$51,C2)
The formula worksheet in Figure 2.20 shows the cell formulae inserted by applying these
steps. The value worksheet shows the values computed by the cell formulae. This worksheet
Here we show how Excel’s chart tools can be used to construct a bar chart for the new car
purchase data. Refer to the frequency distribution shown in the foreground of Figure 2.20.
The bar chart we are going to construct is an extension of this worksheet. The steps are
shown below. We begin by ordering the brands from highest to lowest frequency, which
Step
2 Click the Home tab on the Ribbon, then in the Sort & Filter group click
Custom Sort
Smallest
4 Click OK
5 Click the Insert tab on the Ribbon, then in the Recommended Charts group
6 Highlight Chart Title on the chart, and key in Bar Chart of New Car
Purchases
7 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Horizontal. Highlight Axis Title, then key in the axis title Car
brand
8 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Vertical. Highlight Axis Title, then key in the axis title
Frequency
The resulting bar chart is shown in Figure 2.21. The bar chart in Figure 2.21 can be resized.
First, select the chart. Sizing handles will appear on the chart border. Click on the sizing
COUNTIF function
Figure 2.21 Bar chart of new car purchases constructed using Excel
Excel can produce a pie chart for the car purchase data in a similar fashion. The major
difference is that in step 5 we would click Pie in the Recommended Charts group. Several
In this section we show how Excel can be used to construct a frequency distribution and a
histogram for quantitative data. We illustrate each using the audit time data shown in Table
Frequency distribution
Audit
Excel’s FREQUENCY function can be used to construct a frequency distribution for
quantitative data. Refer to Figure 2.22 as we describe the steps involved. The formula
worksheet is in the background, and the value worksheet is in the foreground. The label
‘Audit Time’ is in cell A1 and the data for the 20 audits are in cells A2:A21. Using the
procedures described below, we make the five classes 10–14, 15–19, 20–24, 25–29, 30–34.
The label ‘Audit Time’ and the five classes are entered in cells C1:C6. The label ‘Upper
Limit’ and the five class upper limits are entered in cells D1:D6. We also entered the label
‘Frequency’ in cell E1. Excel’s FREQUENCY function will be used to show the class
Step
= FREQUENCY(A2:A21,D2:D6)
3 Press CTRL + SHIFT + ENTER and the array formula will be entered
The results are shown in Figure 2.22. The values displayed in the cells E2:E6 are the
frequencies for the corresponding classes. Referring to the FREQUENCY function, we see
that the range of cells for the upper class limits (D2:D6) provides input to the function. These
upper class limits, which EXCEL refers to as bins, tell EXCEL which frequency to put into
the cells of the output range (E2:E6). For example, the frequency for the class with an upper
limit, or bin, of 14 is placed in the first cell (E2), the frequency for the class with an upper
Histogram
To use Excel to construct a histogram for the audit time data, we begin with the frequency
distribution as shown in Figure 2.22. The histogram output is also shown in Figure 2.22. The
Step
5 Highlight Chart Title on the chart, and key in Histogram for Audit Time Data
6 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Horizontal. Highlight Axis Title, key in the axis title Audit Time in
Days
7 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Vertical. Highlight Axis Title, key in the axis title Frequency
8 Right-click any of the bars in the chart, select Format Data Series, then move the
An interesting aspect of the worksheet in Figure 2.22 is that Excel has linked the data in
cells A2:A21 to the frequencies in cells E2:E6 and to the histogram. If the data in cells
A2:A21 are edited or revised, the frequencies in cells E2:E6 and the histogram will be
updated automatically to display a revised frequency distribution and histogram. Try one or
PivotTable report
Restaurant
EXCEL’s PivotTable Report provides a valuable tool for managing data sets involving more
than one variable. We shall illustrate its use by showing how to construct a cross-tabulation
using the restaurant data in Figure 2.23. Labels are entered in row 1, and the data for each of
The following steps create a worksheet containing the initial PivotTable report and
PivotTable Fields panel. The resulting PivotTable Fields panel is shown in Figure 2.24.
Step
Click OK
.
Figure 2.24 PivotTable Fields panel
Each column in Figure 2.23 (Restaurant, Quality Rating, and Meal Price) is considered a field
by Excel. The following steps show how to use Excel’s PivotTable Fields panel to move the
Quality Rating field to the row section, the Meal Price (€) field to the column section, and the
Step
area
Click OK
Figure 2.25 shows the completed PivotTable Field panel and a portion of the PivotTable
report.
Figure 2.25 Completed PivotTable field list and a portion of PivotTable Report
To complete the PivotTable report, the following steps group the columns representing meal
prices and place the row labels for quality rating in the proper order.
Ste
Select Group
Click OK
Choose Move
Restaurant
Figure 2.8 in the book shows a stacked bar chart (produced in SPSS) for the restaurant survey
start from the PivotTable report produced above, shown in Figure 2.26.
Step
3 Click on PivotChart
Right-click on any bar, click on Change Chart Type, click on Column, click
5 Right-click somewhere around the periphery pf the chart area, click on Show
Field List
In the PivotChart Fields panel, drag Meal Price (€) to the Axis (Categories)
6 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Horizontal. Highlight Axis Title, key in the axis title Meal price (€)
7 Click Design on the Ribbon, then select Add Chart Element > Axis Titles >
Primary Vertical. Highlight Axis Title, key in the axis title Quality rating
8 Click Design on the Ribbon, then select Add Chart Element > Chart Title.
Highlight Chart Title, key in the axis title Percentage distribution of quality
At the end of Step 4, Excel produces a stacked bar chart showing the percentage
distribution of meal prices (vertical axis) within each quality rating category (horizontal axis).
The stacked bar chart in Figure 2.8 of the book shows the percentage distribution of quality
ratings (vertical axis) for each meal price category (horizontal axis). Step 5 above swaps
around the roles of the two variables to produce the same type of stacked bar chart as shown
in Figure 2.8. The final result after Step 5 is shown in Figure 2.27.
Figure 2.27 Stacked bar chart for the restaurant survey data, using Excel
Scatter diagram
We use the digital equipment online store data in Table 2.12 of the book to demonstrate the
use of Excel to construct a scatter diagram. Refer to Figure 2.28 as we describe the steps
involved. The data columns are to the left in the Figure, and the scatter diagram produced by
Excel on the right. The following steps will produce the scatter diagram.
Step
3 In the Recommended Charts group, click Scatter (the chart will appear in the
worksheet)
4 Highlight Chart Title on the chart, and key in Scatter Diagram for the Digital
5 Click Chart Design on the Ribbon, then select Add Chart Element > Axis
Titles > Primary Horizontal. Highlight Axis Title, then key in the axis title
Number of Promotions
6 Click Chart Design on the Ribbon, then select Add Chart Element > Axis
Titles > Primary Vertical. Highlight Axis Title, then key in the axis title
Sales Volume
9 Position the mouse pointer over any data point in the scatter diagram and
Choose Linear
The worksheet in Figure 2.28 shows the scatter diagram with the trend line added.
Figure 2.28 Scatter diagram for digital equipment online store data, using Excel