0% found this document useful (0 votes)
170 views55 pages

Excel-2013-Data-Analysis-and-Business-Modeling Pivot OK PDF

This document provides answers to questions about using pivot tables and slicers to analyze and summarize data. It begins by explaining what a pivot table is and how it can be used to quickly summarize grocery sales data from multiple stores over time by product group. It then demonstrates how to create a pivot table from this grocery sales data, including selecting the data range, adding fields to the row, column, values, and report filter areas. The document provides examples of how pivot tables can be used to analyze factors that influence travel expenditures, likelihood of purchasing a station wagon, and displaying monthly sales data by country and product for a microchip manufacturer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views55 pages

Excel-2013-Data-Analysis-and-Business-Modeling Pivot OK PDF

This document provides answers to questions about using pivot tables and slicers to analyze and summarize data. It begins by explaining what a pivot table is and how it can be used to quickly summarize grocery sales data from multiple stores over time by product group. It then demonstrates how to create a pivot table from this grocery sales data, including selecting the data range, adding fields to the row, column, values, and report filter areas. The document provides examples of how pivot tables can be used to analyze factors that influence travel expenditures, likelihood of purchasing a station wagon, and displaying monthly sales data by country and product for a microchip manufacturer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

CHAPTER 43

Using PivotTables and slicers to


describe data

Questions answered in this chapter:


■■ What is a PivotTable?

■■ How can I use a PivotTable to summarize grocery sales at several grocery stores?

■■ What PivotTable layouts are available in Excel 2013?

■■ Why is a PivotTable called a PivotTable?

■■ How can I easily change the format in a PivotTable?

■■ How can I collapse and expand fields?

■■ How can I sort and filter PivotTable fields?

■■ How can I summarize a PivotTable by using a PivotChart?

■■ How can I use the Report Filter section of the PivotTable?

■■ How do PivotTable slicers work?

■■ How can I add blank rows or hide subtotals in a PivotTable?

■■ How can I apply conditional formatting to a PivotTable?

■■ How can I update my calculations when I add new data?

■■ I work for a small travel agency for which I need to mass-mail a travel brochure. My funds are
limited, so I want to mail the brochure to people who spend the most money on travel. From
information in a random sample of 925 people, I know the gender, the age, and the amount
these people spent on travel last year. How can I use this data to determine how gender and
age influence a person’s travel expenditures? What can I conclude about the type of person to
whom I should mail the brochure?

385

■■ I’m doing market research about station wagons. I need to determine what factors influence
the likelihood that a family will purchase a station wagon. From information in a large sample
of families, I know the family size (large or small) and the family income (high or low). How can
I determine how family size and income influence the likelihood that a family will purchase a
station wagon?

■■ I work for a manufacturer that sells microchips globally. I’m given monthly actual and pre-
dicted sales for Canada, France, and the United States for Chip 1, Chip 2, and Chip 3. I’m also
given the variance, or difference, between actual and budgeted revenues. For each month and
each combination of country and product, I’d like to display the following data: actual rev-
enue, budgeted revenue, actual variance, actual revenue as a percentage of annual revenue,
and variance as a percentage of budgeted revenue. How can I display this information?

■■ What is a calculated field?

■■ How can I use a report filter or slicer?

■■ How can I group items in a PivotTable?

■■ What is a calculated item?

■■ What is “drilling down”?

■■ I often have to use specific data in a PivotTable to determine profit, such as the April sales in
France of Chip 1. Unfortunately, this data moves around when new fields are added to my
PivotTable. Does Excel have a function that enables me always to extract April’s Chip 1 sales in
France from the PivotTable?

■■ How can I use the New Excel 2013 Timeline feature to summarize data during different time
periods?

■■ How can I use a PivotTable to summarize total sales to date during a year?

■■ How can I use a PivotTable to summarize sales this month compared to the same month a
year earlier?

■■ How can I create a PivotTable based on data in several locations?

■■ How can I create a PivotTable based on an already created PivotTable?

Answers to this chapter’s questions


This section provides the answers to the questions that are listed at the beginning of the chapter.

What is a PivotTable?

In numerous business situations, you need to analyze, or slice and dice, your data to gain important
insights. Imagine that you sell different grocery products in different stores at different points in time.
You might have hundreds of thousands of data points to track. PivotTables enable you to summarize

386  Chapter 43  Using PivotTables and slicers to describe data


your data quickly in almost any way imaginable. For example, for your grocery store data, you could
use a PivotTable to determine the following quickly:

■■ Amount spent per year in each store on each product

■■ Total spending at each store

■■ Total spending for each year

In a travel agency, as another example, you might slice data so that you can determine whether
the average amount spent on travel is influenced by age or gender or by both factors. In analyzing
automobile purchases, you’d like to compare the fraction of large families that buy a station wagon
to the fraction of small families that purchase a station wagon. For a microchip manufacturer, you’d
like to determine total Chip 1 sales in France, for example, during April, and so on. A PivotTable is an
incredibly powerful tool that you can use to slice and dice data. The easiest way to understand how a
PivotTable works is to walk through some carefully constructed examples, so get started! Begin with
an introductory example and then explore many advanced PivotTable features through subsequent
examples.

How can I use a PivotTable to summarize grocery sales at several grocery stores?

The Data worksheet in the Groceriespt.xlsx file contains more than 900 rows of sales data. (See
Figure 43-1.) Each row contains the number of units sold and revenue of a product at a store as well
as the month and year of the sale. The product group (fruit, milk, cereal, or ice cream) is also included.
You would like to see a breakdown of sales during each year of each product group and product at
each store. You would also like to be able to show this breakdown during any subset of months in a
given year (for example, what the sales were from January through June).

Using PivotTables and slicers to describe data  Chapter 43   387


FIGURE 43-1  This is the data for the grocery PivotTable example.

Before creating a PivotTable, you must have headings in the first row of your data. Notice that the
grocery data contains headings (Year, Month, Store, Group, Product, Units, and Revenue) in row 2.
Place your cursor anywhere in the data and then click PivotTable in the Tables group on the Insert
tab. Excel opens the Create PivotTable dialog box, shown in Figure 43-2, and makes an assumption
about your data range. (In this case, Excel correctly guessed that the data range was A1:G923.) By
selecting Use An External Data Source, you can also refer to a database as a source for a PivotTable.
Data Model, new in Excel 2013, is discussed in Chapter 44, “The Data Model.”

388  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-2  This is the Create PivotTable dialog box.

After you click OK, you see the PivotTable Fields list shown in Figure 43-3.

Using PivotTables and slicers to describe data  Chapter 43   389


FIGURE 43-3  This is the PivotTable Fields list.

You fill in the PivotTable Field list by dragging PivotTable headings, or fields, into the boxes, or
zones. This step is critical to ensuring that the PivotTable summarizes and displays the data in the
manner you want. The four zones are as follows:

■■ Row Labels  Fields dragged here are listed on the left side of the table in the order in which
they are added to the box. For example, you can drag the Year, Group, Product, and Store
fields, in that order, to the Row Labels box. This causes Excel to summarize data first by year,
then for each product group within a given year, then by product within each group, and,
finally, each product by store. At any time, you can drag a field to a different zone or reorder
the fields within a zone by dragging a field up or down in a zone or by clicking the arrow to
the right of the field label.

■■ Column Labels  Fields dragged here have their values listed across the top row of the
PivotTable. To start out this example, you have no fields in the Column Labels zone.

390  Chapter 43  Using PivotTables and slicers to describe data


■■ Values  Fields dragged here are summarized mathematically in the table. Units and Revenue
(in that order) have been dragged to this zone. Excel tries to guess what kind of calculation
you want to perform on a field. In this example, Excel guesses that Revenue and Units should
be summed, which happens to be correct. If you want to change the method of calculation for
a data field to an average, a count, or something else, click the data field and choose Value
Field Settings. An example of how to use the Value Field Settings command is given later in
the chapter. If you select a numeric field from the field list, the field is automatically added to
the Values zone and aggregated by using Sum. If you select a nonnumeric field from the field
list, the field is automatically placed in the Rows zone.

■■ Report Filter  Beginning in Excel 2007, Report Filter is the new name for the old Page Field
area. For fields dragged to the Report Filter area, you can easily pick any subset of the field
values so that the PivotTable shows calculations based only on that subset. In this example,
Month was dragged to the Report Filter area. You can easily select any subset of months, for
example January to June, and the calculations are based on only those months.

The completed PivotTable Fields is shown in Figure 43-4. The resulting PivotTable is shown in
Figure 43-5 and in the All Row Fields worksheet of the Groceriespt.xlsx workbook. In row 5, you can
see that 243,228 units were sold for $728,218.68 in 2005.

Tip  Here is some advice about navigating between worksheets:


■■ Control+PageUp key sequence moves you back one worksheet.
■■ Control+PageDn key sequence moves you forward one worksheet.
■■ Right-clicking either of the arrows to the left of the first worksheet name brings up a
list of worksheet names from which you can move to any worksheet in the workbook.

Note  To see the field list, you need to be in a field in the PivotTable. If you do not see the
field list, right-click any cell in the PivotTable and select Show Field List.

Using PivotTables and slicers to describe data  Chapter 43   391


FIGURE 43-4  This is the completed PivotTable Fields list.

392  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-5  This is the grocery PivotTable in compact form.

What PivotTable layouts are available?

The PivotTable layout shown in Figure 43-5 is called the compact form. In the compact form, the row
fields are shown one on top of another. To change the layout, first place your cursor anywhere within
the table. On the Design tab, in the Layout Group, click Report Layout and choose one of the fol-
lowing: Show In Compact Form (see Figure 43-5), Show In Outline Form (see Figure 43-6 and the
Outline Form worksheet), or Show In Tabular Form (Figure 43-7 and the Tabular Form worksheet).

Using PivotTables and slicers to describe data  Chapter 43   393


FIGURE 43-6  This is the outline form.

FIGURE 43-7  This is the tabular form.

394  Chapter 43  Using PivotTables and slicers to describe data


Why is a PivotTable called a PivotTable?

You can easily pivot fields from a row to a column and vice versa to create a different layout. For
example, by dragging the Year field to the Column Labels box, you create the PivotTable layout
shown in Figure 43-8. (See the Years Column worksheet.)

FIGURE 43-8  The Years field is pivoted to the column field.

How can I easily change the format in a PivotTable?

If you want to change the format of an entire column field, double-click the column heading and click
Number Format in the Value Field Settings dialog box. Apply the format you want. For example, in
the Formatted $s worksheet, the Revenue field is formatted as currency by double-clicking the Sum
Of Revenue heading and applying a currency format. You can also change the format of a value field
by clicking the arrow to the right of the Value field in PivotTable Fields. Select Value Field Settings
followed by Number Format, and then you can reformat the column as you want it.

From any cell in a PivotTable, you can select the Design tab on the ribbon to reveal many
PivotTable styles.

How can I collapse and expand fields?

Expanding and collapsing fields (a feature introduced in Excel 2007) is a great advantage in
PivotTables. In Figure 43-5, you see minus (–) signs by each year, group, and product. Clicking the
minus sign collapses a field and changes the sign to a plus (+) sign. Clicking the plus sign expands the
field. For example, if you click the minus sign by cereal in any cell in column A, you find that in each
year, cereal is contracted to one row, and the various cereal stores are no longer listed. See Figure
43-9 and the Cerealcollapse worksheet. Clicking the plus sign in cell A6 brings back the detailed or
expanded view listing sales for each individual cereal.

Using PivotTables and slicers to describe data  Chapter 43   395


FIGURE 43-9  The cereal item is collapsed.

You can also expand or contract an entire field. Go to any row containing a member of that field
and select PivotTable Tools Analyze on the ribbon. In the Active Field group, click either the green
Expand Field button (labeled with a plus sign) or the red Contract Field button (labeled with a
minus sign). (See Figure 43-10.)

FIGURE 43-10  This shows the Expand Field and Collapse Field button.

For example, suppose you simply want to see only the sales by product group for each year.
Pick any cell containing a group’s name (for example, A6), select PivotTable Tools Options on the
ribbon, and click the Collapse Field button. You see the result shown in Figure 43-11 (the Groups
Collapsed worksheet). Selecting the Expand Field button brings you back to the original view.

396  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-11  The Group field is collapsed.

How can I sort and filter PivotTable fields?

In Figure 43-5, the products are listed alphabetically within each group. For example, Cheerios is the
first type of cereal listed. If you want the products to be listed in reverse alphabetical order, simply
move the cursor to any cell containing a product (for example, A7 containing Cheerios in the All Row
Fields worksheet) and click the drop-down arrow to the right of Row Labels in A5. You see the list
of filtering options shown in Figure 43-12. Selecting Sort Z To A as shown in Figure 43-12 would list
Special K first for Cereal, whole milk first for Milk, plums for Fruit, and so on.

Initially, your PivotTable displays results first from 2005, then 2006, and then 2007. If you want to
see the data for 2007 first, move the cursor to any cell containing a year (for example, A5) and choose
Sort Largest To Smallest from the available options.

At the bottom of the filtering options dialog box, you can also select any subset of products to be
displayed. You might want to clear Select All first and then select the products you want to show.

Using PivotTables and slicers to describe data  Chapter 43   397


FIGURE 43-12  These are the PivotTable filtering options for the Product field.

For another example of filtering, look at the Data worksheet in the Ptcustomers.xlsx file, shown in
Figure 43-13. The worksheet data contains the customer number, the amount paid, and the quarter of
the year in which payment was received for each customer transaction. After dragging Customer to
the Row Labels box, Quarter to the Column Labels box, and Paid to the Values box, the PivotTable
shown in Figure 43-14 is displayed. (See the Ptable worksheet in the Pcustomers.xlsx file.)

398  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-13  The Customer PivotTable data.

Using PivotTables and slicers to describe data  Chapter 43   399


FIGURE 43-14  This is the Customer PivotTable.

Naturally, you might like to show a list of just your top 10 customers. To obtain this layout, click
the Row Labels arrow and select Value Filters. Choose Top 10 Items to obtain the layout shown in
Figure 43-15. (See the Top 10 cus worksheet.) Of course, by selecting Clear Filter, you can return to
the original layout.

400  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-15  This figure shows Top 10 customers.

Suppose you simply want to see the top customers that generate 50 percent of your revenue.
Select the Row Labels filtering icon, select Value Filters and Top 10, and fill in the dialog box as
shown in Figure 43-16.

FIGURE 43-16  Configure the Top 10 Filter dialog box to show customers generating 50 percent of revenue.

The resulting PivotTable is in the Top Half worksheet and shown in Figure 43-17. As you can see,
the top 14 customers generate a little more than half of the revenue.

Using PivotTables and slicers to describe data  Chapter 43   401


FIGURE 43-17  The top customers generate half of the revenues.

Now suppose you want to sort your customers by Quarter 1 revenue. (See the Sorted q1 work-
sheet.) Right-click anywhere in the Quarter 1 column, point to Sort, and then click Sort Largest To
Smallest. The resulting PivotTable is shown in Figure 43-18. Note that Customer 13 paid the most in
Quarter 1, Customer 2 paid the second most, and so on.

402  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-18  Customers are sorted on Quarter 1 revenue.

How can I summarize a PivotTable by using a PivotChart?

Excel makes it easy to summarize PivotTables visually by using PivotCharts. The key to laying out the
data the way you want it in a PivotChart is to sort data and collapse or expand fields. In the grocery
example, suppose you want to summarize the trend over time of each food group’s unit sales. (See
the Chart 2 worksheet in the Groceriespt.xlsx file.) You should move the Year field to the Row area
and delete Revenue from the Values area. You also need to collapse the entire Group field in the
Row Labels zone and move Groups to the Column area. Now you are ready to create a PivotChart.
Click anywhere inside the table and select PivotChart from the Analyze tab. Now pick the chart type
you want to create. The fourth Line Graph option, which displays the chart shown in Figure 43-19, has
been chosen here. The chart shows that milk sales were highest in 2005 and lowest in 2006.

Using PivotTables and slicers to describe data  Chapter 43   403


FIGURE 43-19  This is the PivotChart for the unit group sales trend.

How can I use the Report Filter section of the PivotTable?

Recall that Months was placed in the Report Filter section of the table. To see how to use a report
filter, suppose that you want to summarize sales for the months of January to June. By clicking the
Filter icon in cell B2 of the First 6 months worksheet, you can select January–June. This results in the
PivotTable shown in Figure 43-20, which summarizes the number of units sold by product, group, and
year for the months of January to June.

404  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-20  A PivotTable summarizing January to June sales.

How do PivotTable slicers work?

The problem with a report filter is that a viewer of the PivotTable shown in Figure 43-20 cannot easily
see that the table summarizes January to June sales. The Excel slicer feature (introduced in Excel 2010)
neatly solves this problem. To create a slicer for any of the columns of data used to generate your
PivotTable, place your cursor anywhere in the PivotTable and then click Slicer on the ribbon’s Insert
tab. In the Slicers worksheet of the Groceriespt.xlsx file, Slicer was selected from the Insert menu. The
Month and Product fields were selected to create slicers for Month and Product. Using a given slicer,
you can select any subset of possible values to be used in creating your table. In the Month slicer, the
months January through June were selected (one at a time while holding down the Ctrl key). Nothing
was done to the Product slicer, so the data is based on January to June sales. The slicers are shown in
Figure 43-21.

You can also add a slicer for a field by right-clicking the field in the PivotTable Fields pane and
selecting Add As Slicer.

Using PivotTables and slicers to describe data  Chapter 43   405


FIGURE 43-21  Here is an example of slicers for the Month and Product fields.

If you select a slicer, on the Slicer Tools Options ribbon tab, you see formatting options that
enable you to change its appearance. For example, you can change the height and width as well as
the number of columns in the slicer. You can also easily resize a slicer by dragging its sides or corners.

How can I add blank rows or hide subtotals in a PivotTable?

If you want to add a blank row between each grouped item, select PivotTable Tools Design on
the ribbon, click Blank Rows, and then click Insert Blank Line After Each Item. If you want to
hide subtotals or grand totals, select PivotTable Tools Design and then select Subtotals or Grand
Totals. After adding blank rows and hiding all totals, you can obtain the table in the Blank rows no
totals worksheet of the Grocerypt.xlsx workbook, shown in Figure 43-22. After right-clicking in any
PivotTable cell, you can select PivotTable Options to open the PivotTable Options dialog box.

406  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-22  Here is the grocery PivotTable without totals.

How can I apply conditional formatting to a PivotTable?

Suppose you want to apply data bars to the Units column in the grocery PivotTable. One problem
you’ll encounter is that subtotals and grand totals will have large data bars and make the other data
bars smaller than they should be. It’s better to have the data bars apply to all product sales, not the
subtotals and grand totals. (See the Cond form worksheet of workbook Groceriespt.xlsx.) To apply
the data bars to only the unit sales by product, begin by placing the cursor in any cell containing
unit sales for a product (for example, chocolate milk in B8). On the Home tab, click Conditional
Formatting followed by Data Bars and then choose More Rules. You see the New Formatting Rule
dialog box shown in Figure 43-23.

Using PivotTables and slicers to describe data  Chapter 43   407


FIGURE 43-23  This is the New Formatting Rule dialog box for using conditional formatting with PivotTables.

By selecting All Cells Showing “Sum of Units” Values For “Product” and selecting the
$B$8:$B$227 range, you can ensure that data bars apply only to cells listing unit sales for products, as
you can see in the Cond form worksheet and Figure 43-24.

408  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-24  This figure shows data bars for a PivotTable.

How can I update my calculations when I add new data?

If the data in your original set of rows changes, you can update your PivotTable to include the data
changes by right-clicking the table and selecting Refresh. You can also select Refresh from the
Analyze tab.

If you want data you add to be automatically included in your PivotTable calculations when you
refresh it, you should define your original data set as a table by selecting it with Ctrl+T. (See Chapter
25, “Tables,” for more information.)

If you want to change the range of data used to create a PivotTable, you can always select Change
Data Source on the Analyze tab. You can also move the table to a different location by selecting
Move PivotTable.

Using PivotTables and slicers to describe data  Chapter 43   409


I work for a small travel agency for which I need to mass-mail a travel brochure. My funds are
limited, so I want to mail the brochure to people who spend the most money on travel. From
information in a random sample of 925 people, I know the gender, the age, and the amount
these people spent on travel last year. How can I use this data to determine how gender and
age influence a person’s travel expenditures? What can I conclude about the type of person to
whom I should mail the brochure?

To understand this data, you need to break it down as follows:

■■ Average amount spent on travel by gender

■■ Average amount spent on travel for each age group

■■ Average amount spent on travel by gender for each age group

The data is included on the Data worksheet in the Traveldata.xlsx file, and a sample is shown in
Figure 43-25. For example, the first person is a 44-year-old male who spent $997 on travel.

FIGURE 43-25  This is travel agency data showing age, gender, and amount spent on travel.

First, get a breakdown of spending by gender. Begin by selecting Insert PivotTable. Excel extracts
the A2:D927 range. After clicking OK, put the cursor in the table so that the field list appears. Next,

410  Chapter 43  Using PivotTables and slicers to describe data


drag the Gender column to the Row Labels zone and drag Amount Spent On Travel to the Values
zone. This results in the PivotTable shown in Figure 43-26.

You can tell from the heading, Sum Of Amount Spent On Travel, that you are summarizing the
total amount spent on travel, but you actually want the average amount spent on travel by men
and women. To calculate these quantities, double-click Sum Of Amount Spent On Travel from the
PivotTable (not the field list!) and then select Average from the Value Field Settings dialog box,
shown in Figure 43-27.

FIGURE 43-26  This PivotTable summarizes the total travel expenditures by gender.

FIGURE 43-27  You can select a different summary function in the Value Field Settings dialog box.

Using PivotTables and slicers to describe data  Chapter 43   411


You now see the results, shown in Figure 43-28.

FIGURE 43-28  Here are the average travel expenditures by gender.

On average, people spend $908.13 on travel. Women spend an average of $901.16, whereas men
spend $914.99. This PivotTable indicates that gender has little influence on the propensity to travel. By
clicking the Row Labels arrow, you can filter to show just male or female results.

Now you want to see how age influences travel spending. Switch Gender to the Columns zone
of the PivotTable by dragging Gender from the Row Labels zone to the Column Labels zone. To
break down spending by age, drag Age to the Row area. The PivotTable now appears as it’s shown in
Figure 43-29.

FIGURE 43-29  This PivotTable shows the average travel expenditures by age and gender.

412  Chapter 43  Using PivotTables and slicers to describe data


Age seems to have little effect on travel expenditures. In fact, this PivotTable is pretty useless
in its present state. You need to group data by age to see any trends. To group the results by age,
right-click anywhere in the Age column and choose Group. In the Grouping dialog box (shown in
Figure 43-30), you can designate the interval by which to define an age group. By using 10-year incre-
ments, you obtain the PivotTable shown in Figure 43-31.

On average, 25–34-year-olds spend $935.84 on travel, 55–64-year-olds spend $903.57 on travel,


and so on. This information is more useful, but it still indicates that people of all ages tend to spend
about the same amount on travel. This view of the data does not help determine whom you should
mail your brochure to.

FIGURE 43-30  Use the Group And Show Detail command to group detailed records.

Finally, get a breakdown of average travel spending by age for men and women separately. All
you have to do is drag Gender to the Column Labels zone of the field list, resulting in the PivotTable
shown in Figure 43-31. (See the Final Table worksheet.)

FIGURE 43-31  This is the age and gender breakdown of travel spending.

Now you’re cooking! You can see that as age increases, women spend more on travel and men
spend less. Now you know who should get the brochure: older women and younger men. As a stu-
dent once said, “That would be some kind of cruise!”

Using PivotTables and slicers to describe data  Chapter 43   413


A graph provides a nice summary of this analysis. Move the cursor inside the PivotTable and, from
the Analyze tab on the ribbon, select PivotChart. A menu of recommended charts appears. The first
choice (Clustered Column) has been selected. The result is the chart shown in Figure 43-32. If you
want to edit the chart further, select PivotChart Tools. Then, for example, if you choose Layout, you
can add titles to the chart and axis and make other changes.

FIGURE 43-32  This is a PivotChart for the age and gender travel expenditure breakdown.

Each age group spends approximately the same on travel, but as age increases, women spend
more than men. (If you want to use a different type of chart, you can change the chart type by right-
clicking the PivotChart and then choosing Chart Type.)

Notice that the bars showing expenditures by males decrease with age, and the bars representing
the amount spent by women increase with age. You can see why the PivotTables that showed only
gender and age data failed to unmask this pattern. Because half your sample population is men and
half is women, you found that the average amount spent by people does not depend on their age.
(Notice that the average height of the two bars for each age is approximately the same.) You also
found that the average amount spent by men and women was approximately the same. You can see
this because, averaged over all ages, the blue and red bars have approximately equal heights. Slicing
and dicing the data simultaneously across age and gender does a much better job of showing you the
real information.

Note that by clicking the drop-down arrow associated with A, you could filter the graph on Age,
and by clicking the drop-down arrow associated with Gen, you could filter the graph based on
Gender.

I’m doing market research about station wagons. I need to determine what factors influence
the likelihood that a family will purchase a station wagon. From information in a large sample

414  Chapter 43  Using PivotTables and slicers to describe data


of families, I know the family size (large or small) and the family income (high or low). How
can I determine how family size and income influence the likelihood that a family will pur-
chase a station wagon?

In the Station.xlsx file, you can find the following information:

■■ Is the family size large or small?

■■ Is the family’s income high or low?

■■ Did the family buy a station wagon? Yes or No.

A sample of the data is shown in Figure 43-33 (see the Data worksheet). For example, the first fam-
ily listed is a small, high-income family that did not buy a station wagon.

FIGURE 43-33  This is data collected about income, family size, and the purchase of a station wagon.

You want to determine how family size and income influence the likelihood that a family will pur-
chase a station wagon. The trick is to look at how income affects purchases for each family size and
how family size affects purchases for each income level.

To begin, choose Insert Pivot Table and then select the data (the B2:D345 cell range). Using
PivotTable Fields, drag Family Size to the Row Labels area, Station Wagon to the Column Labels

Using PivotTables and slicers to describe data  Chapter 43   415


area, and any of the three fields to the Values area. The result is the PivotTable shown in Figure 43-34.
(See the 1st Table worksheet.) Notice that Excel has chosen to summarize the data appropriately by
counting the number of observations in each category. For example, 34 high-salary, large families did
not buy a station wagon, whereas 100 high-salary, large families did buy one.

FIGURE 43-34  This is a summary of station wagon ownership by family size and salary.

You would like to know for each row in the PivotTable the percentage of families that purchased a
station wagon. To display the data in this format, right-click any value cell in the PivotTable data and
then choose Value Field Settings, which opens the Value Field Settings dialog box. In the dialog
box, click Show Values As and then select % Of Row in the Show Data As list. You now obtain the
PivotTable shown in Figure 43-35. (See the 1st Percent Breakdown worksheet.)

FIGURE 43-35  This is the percentage breakdown of station wagon ownership by income for large and small
families.

416  Chapter 43  Using PivotTables and slicers to describe data


From Figure 43-35, you learn that for both large and small families, income has little effect on
whether the family purchases a station wagon. Now you need to determine how family size affects
the propensity to buy a station wagon for high-income and low-income families. To do this, move
Salary above Family Size in the Row Labels zone, resulting in the PivotTable shown in Figure 43-36.
(See the Final Percent Breakdown worksheet.)

FIGURE 43-36  This is the breakdown of station wagon ownership by family size for high and low salaries.

From this table, you learn that for high-income families, a large family is much more likely to buy a
station wagon than a small family. Similarly, for low-income families, a large family is also more likely
to purchase a wagon than a small family. The bottom line is that family size has a much greater effect
on the likelihood that a family will purchase a station wagon than income.

I work for a manufacturer that sells microchips globally. I’m given monthly actual and pre-
dicted sales for Canada, France, and the United States for Chip 1, Chip 2, and Chip 3. I’m also
given the variance, or difference, between actual and budgeted revenues. For each month
and each combination of country and product, I’d like to display the following data: actual
revenue, budgeted revenue, actual variance, actual revenue as a percentage of annual rev-
enue, and variance as a percentage of budgeted revenue. How can I display this information?

In this scenario, you are a finance manager for a microchip manufacturer. You sell your products in
different countries and regions and at different times. PivotTables can help you summarize your data
in a format that’s easily understood.

The Ptableexample.xlsx file includes monthly actual and predicted sales during 1997 of Chip 1,
Chip 2, and Chip 3 in Canada, France, and the United States. The file also contains the variance, or
difference, between actual revenues and budgeted revenues. A sample of the data is shown in Figure
43-37. (See the Data worksheet.) For example, in the United States in January, sales of Chip 1 totaled
$4,000, although sales of $5,454 were predicted. This yielded a variance of –$1,454.

Using PivotTables and slicers to describe data  Chapter 43   417


FIGURE 43-37  Chip data from different countries for different months shows actual, budget, and
variance revenues.

For each month and each combination of country and product, you would like to display the fol-
lowing data:

■■ Actual revenue

■■ Budgeted revenue

■■ Actual variance

■■ Actual revenue as a percentage of annual revenue

■■ Variance as a percentage of budgeted revenue

To begin, select a cell within the range of data you’re working with (remember that the first row
must include headings) and then choose Insert PivotTable. Excel automatically determines that your
data is in the A1:F208 range.

If you drag Month to the Rows zone, Country to the Columns zone, and Revenue to the Values
area, for example, you obtain the total revenue each month by country. A field you add to the Filters
zone (Product, for example) enables you to filter your PivotTable by using values in that field. By add-
ing Product to the Filters zone, you can view sales of only Chip 1 by month for each country. Given

418  Chapter 43  Using PivotTables and slicers to describe data


that you want to be able to show data for any combination of country and product, you should add
Month to the Rows zone of the PivotTable and both Country and Product to the Filters zone. Next,
drag Var, Revenue, and Budget to the Values zone. You have now created the PivotTable that is
shown in Figure 43-38. (See the 1st Table worksheet.)

FIGURE 43-38  This is a monthly summary of revenue, budget, and variance.

For example, in January, total revenue was $87,534, and total budgeted sales were $91,831, so
actual sales fell $4,297 short of the forecast.

You want to determine the percentage of revenue earned during each month. Again, drag
Revenue from the field list to the Values area of the PivotTable. Right-click in this value column and
then choose Value Field Settings. In the Value Field Settings dialog box, click Show Values As. In
the Show Values As list, select % Of Column and rename this field as Sum Of Revenue2, as shown
in Figure 43-39.

You now obtain the PivotTable shown in Figure 43-40. (See the 2nd Table worksheet.) January sales
provided 8.53 percent of revenue. Total revenue for the year was $1,026,278.

Using PivotTables and slicers to describe data  Chapter 43   419


FIGURE 43-39  Create each month’s percentage of annual revenue.

FIGURE 43-40  This is the monthly revenue breakdown.

420  Chapter 43  Using PivotTables and slicers to describe data


Instead of using Value Fields Settings to change the display of a data field, you may change the
way a Values field is displayed by right-clicking a value cell and selecting Show Values As.

What is a calculated field?

Now you want to determine for each month the variance as a percentage of total sales. To do this,
you can create a calculated field. Select a cell anywhere within the data area of the PivotTable and
then choose Fields Items and Sets from the Analyze tab. Choose Calculated Field to open the
Insert Calculated Field dialog box. As shown in Figure 43-41, enter a name for your field and then
enter your formula. The formula for this example is =Var/Budget. You can enter the formula yourself
or use the list of fields and the Insert Field button to add a field to the formula. After clicking Add
and then OK, you see the PivotTable shown in Figure 43-42. (See the Calc Field worksheet of the
Ptableexample.xlsx file.)

FIGURE 43-41  Create a calculated field.

Using PivotTables and slicers to describe data  Chapter 43   421


FIGURE 43-42  This shows the PivotTable with calculated field for variance percentage.

Thus, in January, sales were 4.7 percent lower than budgeted. By opening the Insert Calculated
Field dialog box again, you can modify or delete a calculated field.

How can I use a report filter or slicer?

To see sales of Chip 2 in France, for example, you can select the appropriate values from the Product
and Country fields in the Filters zone. With Chip 2 and France selected, you would see the PivotTable
shown in Figure 43-43. Figure 43-44 shows how to create the same table with slicers (see the Slicers
worksheet).

FIGURE 43-43  This figure shows sales of Chip 2 in France.

In the Slicers worksheet, Slicers was used to create the same table. You can click in the PivotTable
and select Slicers from the Insert tab. Create the slicers shown in Figure 43-44 by selecting the
Product and Country fields. Selecting Chip 2 from the Product slicer and France from the Country

422  Chapter 43  Using PivotTables and slicers to describe data


slicer yields the relevant computations for all transactions involving Chip 2 in France. As was previ-
ously mentioned, you can also create a slicer by right-clicking the field in the Fields list.

FIGURE 43-44  This figure shows sales of Chip 2 in France with slicers.

How can I group items in a PivotTable?

Often, you want to group headings in a PivotTable. For example, you might want to combine sales for
January to March. To create a group, select the items you want to group, right-click the selection, and
then choose Group And Show Detail, Group. After changing the name Group 1 to Jan-March and
deleting Month from the Row Labels section of the PivotTable dialog box, you obtain the PivotTable
shown in Figure 43-45.

Using PivotTables and slicers to describe data  Chapter 43   423


FIGURE 43-45  Grouping items for January, February, and March.

Remarks about grouping


Following are some further insights about using grouping in Excel:

■■ You can disband a group by selecting Group And Show Detail and then Ungroup.

■■ You can group nonadjacent selections by holding down the Ctrl key while you select nonadja-
cent rows or columns.

■■ With numerical values or dates in a row field, you can group by number or dates in arbi-
trary intervals. For example, you can create groups for age ranges and then find the average
income for all 25–34-year-olds.

What is a calculated item?

A calculated item works just like a calculated field except that you are creating one row rather than a
column. To create a calculated item, you should select an item in the row area of the PivotTable, not
an item in the body of the PivotTable. Then, on the Analyze tab, select Fields Items and Sets, fol-
lowed by Calculated Item.

To illustrate how to create a Calculated Item, look at the Calculateditem.xlsx file. In the worksheet
data (see Figure 43-46), you have sales of different car brands. You would like to summarize total sales
by the company’s country (Japan, Germany, or United States).

424  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-46  This is the data for creating a calculated field.

To begin, create a PivotTable listing total sales by country (see worksheet PT1). Drag Brand to the
Rows zone and Sales to the Values zone. You now obtain the PivotTable shown in Figure 43-47.

FIGURE 43-47  The PivotTable is summarizing sales by brand.

Using PivotTables and slicers to describe data  Chapter 43   425


Before creating a calculated item, it is a good idea to hide the Grand Total by selecting Grand
Totals from the Design Tab and selecting Off for Rows and Columns. Otherwise, after you create
the calculated item, the Grand Totals will double-count each car.

To create a calculated item for Japan, put your cursor anywhere in the Row Labels Column of the
PivotTable and then select Fields Items and Sets from the Analyze tab. After selecting Calculated
Item, fill in the dialog box as shown in Figure 43-48 and select OK.

FIGURE 43-48  Create a calculated item for Japan.

This dialog box creates a calculated item for Japan by adding together Honda and Nissan sales.
In a similar fashion, you can create calculated fields that summarize sales in Germany and the United
States. The resulting PivotTable is in worksheet Calc Item and is shown in Figure 43-49.

If you want to delete a calculated item or calculated field, select Calculated Item or Calculated
Field from Fields Items and Sets. From the Name section of the dialog box, select the field or item
you wish to delete and select Delete.

426  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-49  This is a list of calculated items.

If you desire, you may hide the individual brand sales by filtering on the row labels and selecting
just Japan, Germany, and United States.

See problem 11 in the “Problems” section of this chapter for an example of creating a calculated
item. In the chip manufacturing PivotTable example, you could not create a calculated item because
you had multiple copies of the Revenue field.

What is “drilling down”?

“Drilling down” is double-clicking a cell in a PivotTable to display all the detailed data that’s summa-
rized in that field. For example, double-clicking any March entry in the microchip scenario displays the
data that’s related to March sales.

I often have to use specific data in a PivotTable to determine profit, such as the April sales
in France of Chip 1. Unfortunately, this data moves around when new fields are added to my
PivotTable. Does Excel have a function that enables me always to extract April’s Chip 1 sales in
France from the PivotTable?

Yes, there is such a function. The GETPIVOTDATA function fills the bill. Suppose that you want to
extract sales of Chip 1 in France during April from the PivotTable contained in the Data worksheet in
the Getpivotdata.xlsx file. (See Figure 43-50.) Entering the GETPIVOTDATA(A4,”April_France_Chip_1_
Sum_of_Revenue”) formula in cell E2 yields the correct value ($37,600) even if additional products,
countries, and months are added to the PivotTable later. You can also determine the resulting revenue
by pointing to the cell containing Chip 1 April sales in France (cell D26).

The first argument for this function is in the cell in the upper-left corner of the PivotTable (cell A4).
You enclose the PivotTable headings in quotation marks (separated by spaces) that define the entry
you want. The last entry must specify the data field, but other headings can be listed in any order.

Using PivotTables and slicers to describe data  Chapter 43   427


Thus, the formula here means “For the PivotTable whose upper-left corner is in cell A4, find the Sum
of Revenue for Chip 1 in France during April.” This formula returns the correct answer even if the sales
data for Chip 1 in France in April moves to a different location in the PivotTable.

FIGURE 43-50  Use the GETPIVOTDATA function to locate April Chip 1 Sales in France.

If you want simply to return total revenue ($1,026,278), you can enter the GETPIVOTDATA(A4,”Sum_
of_Revenue”) formula (see cell F2).

To see the true power of the GETPIVOTDATA function, suppose you want to summarize sales of
each product by country for each month of the year in a nice table as shown in Figure 43-51.

FIGURE 43-51 Use GETPIVOTDATA to extract April sales of each product in each country.

428  Chapter 43  Using PivotTables and slicers to describe data


To begin, create a drop-down box enabling you to enter the month of the year in cell J9. Enter
the countries in I13:I15 and the products in J12:L12. In cell J13, copy your previous GETPIVOTDATA
formula from E2 and edit it to become =IFERROR(GETPIVOTDATA(“Sum_of_Revenue”,$A$4,”Month”,$
J$9,”Product”,J$12,”Country”,$I13),0). Copying this formula from J13 to J13:L15 pulls the sales of each
product during April from the PivotTable. As you copy across, the product pulls changes, and as you
copy down, the country pulls changes. In each cell, the chosen month is pulled from cell J9. The use of
the IFERROR function ensures that if no sales of a product occurred in a country during the selected
month, you return a 0 instead of an error message. Imagine how useful this trick would be if you sold
1000 products in 200 countries and regions!

Often, the GETPIVOTDATA function is a nuisance. In these cases, you can turn off the option to
use it. Suppose you want to refer to data in cells B5:B11 from a PivotTable elsewhere in your work-
book. You would probably use the =B5 formula and copy it to the B6:B11 range. Hopefully, this
would extract B6, B7, . . . , B11 to the cells you want. Unfortunately, if the GETPIVOTDATA option is
active, you get a bunch of GETPIVOTDATA functions that refer to the same cell. If you want to turn off
GETPIVOTDATA, click the File tab and then click Options. Select Formulas and, under Working With
Formulas, clear the GetPivotData Function For PivotTable References check box. This ensures
that clicking inside a PivotTable yields a formula like =B5 rather than a GETPIVOTDATA function. You
can also turn off GetPivotData in a particular PivotTable by selecting PivotTable from the Analyze
tab. Select Options and, from the drop-down list, clear Generate GetPivotData.

Finally, note that you can also combine the MATCH and OFFSET functions (explained in Chapter 4,
“MATCH function,” and Chapter 21, “The OFFSET function,” respectively) to extract various PivotTable
entries.

How can I use the new Excel 2013 Timeline feature to summarize data during different time
periods?

Excel 2013 introduces a wonderful new feature, Timeline, that enables you to filter your PivotTable
easily based on time periods. Assuming that your data has a column containing actual dates, you
can select any subset of consecutive calendar years, quarters, months, or days in your data, and the
Timeline feature ensures that all PivotTable calculations include only spreadsheet rows from the
selected period.

To illustrate the use of the Timeline feature, look at the Makeuptimeline.xlsx workbook. In the
worksheet data, the following information is listed for 1900 makeup transactions: Salesperson,
Product, Date, Units, and Revenue. In the worksheet Pivot Table, you see a PivotTable that summa-
rizes sales of each product by each salesperson. After clicking anywhere in the PivotTable, click the
Insert tab on the ribbon and select Timeline from the Filters group. You see the timeline shown in
Figure 43-52.

Using PivotTables and slicers to describe data  Chapter 43   429


FIGURE 43-52  This is the timeline for Makeup data.

By using the Shift key, you can select adjacent quarters that can be used to summarize sales. For
example, the Timeline worksheet (see Figure 43-53) summarizes sales during 2004 and the first two
quarters of 2005. Clicking the funnel restores a PivotTable based on all data.

FIGURE 43-53  This timeline summarizes sales for 2004 and first two quarters of 2005.

430  Chapter 43  Using PivotTables and slicers to describe data


How I can use a PivotTable to summarize total sales to date during a year?

Using Value Field Settings makes it easy to summarize total sales to date during a year. To illustrate
this, look at the MonthtoMonth.xlsx file. The Data worksheet contains the Month, Year, and Amount
for a number of sales transactions. To begin, in the Year to Date worksheet, summarize monthly sales
for each year by dragging Month to the Rows area, Year to the Columns area, and Revenues to the
Values area. This yields the PivotTable shown in Figure 43-54.

FIGURE 43-54  This is a summary of sales by month and year.

This figure shows a sales summary broken down by month and year. From anywhere in the
PivotTable, right-click and select Value Field Settings and Show Values As and choose Running
Total In. Select Month. The resulting PivotTable, shown in Figure 43-55 (see worksheet Year to Date),
shows the sales for each month for the given year through that month. For example, sales through
February 2010 were $58,449. You may also create the running totals by right-clicking any values cell
and choosing Show Values As.

Using PivotTables and slicers to describe data  Chapter 43   431


FIGURE 43-55  Here are year-to-date sales totals.

How can I use a PivotTable to summarize sales this month compared to the same month a
year earlier?

Again, you will use the data in the Month to Month workbook. In the Previous Year worksheet, cre-
ate a PivotTable by dragging Month to the Row area, Year to the Column area, and Sales to the
Values area. After right-clicking anywhere in the PivotTable and selecting Value Field Settings,
filling in the dialog box as shown in Figure 43-56 creates the PivotTable shown in Figure 43-57. Here
you see how sales during each month compare to the same month in the previous year. For example,
January 2010 sales increased 704.15 percent over January 2009 sales. Again, you can also change the
display of sales from actual sales to comparing a month to the same month during the previous year
by right-clicking a values cell and selecting Show Values As.

432  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-56  These are the settings needed to compare a month to the same month in the previous year.

FIGURE 43-57  Comparison of sales to the same month during the previous year.

Using PivotTables and slicers to describe data  Chapter 43   433


How can I create a PivotTable based on data in several locations?

Often, the data needed to create a PivotTable can lie in different worksheets or different workbooks.
The key to creating a PivotTable from data in different locations is to press ALT+D+P and open the
classic PivotTable And PivotChart Wizard, shown in Figure 43-58.

FIGURE 43-58  This is the classic PivotTable and PivotChart Wizard opening page.

To illustrate how to create a PivotTable based on data in different ranges, open the East and West
files and, through View Arrange Tiled, display them side by side as shown in Figure 43-59. This data
represents January, February, and March sales in the East and West. You want to produce a PivotTable
that summarizes total sales of each product during each month.

434  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-59  Two files will be summarized with a PivotTable.

To begin, press ALT+D+P and select Multiple Consolidation Ranges, as shown in Figure 43-58.
After selecting Next, select Create A Single Page Field For Me and, from Step 2b of the PivotTable
and PivotChart Wizard, select, as shown in Figure 43-60, the East sales data and click Add to add it
to the range of data that will be used to create your PivotTable.

FIGURE 43-60  Add the East data.

Clear the East data from the Range portion of the page; select the West data and add this data
to the All Ranges section. After clicking Next, you can decide whether to place the final PivotTable
in a new worksheet or the current worksheet. A new worksheet has been chosen here. After selecting
Finish, you obtain the PivotTable (see Figure 43-61) in the PT worksheet of West.xlsx workbook.

Using PivotTables and slicers to describe data  Chapter 43   435


FIGURE 43-61  This PivotTable is summarizing East and West sales.

You find, for example, that total sales of Product A in February were 1317. You can filter on the
products by selecting the drop-down arrow in cell A4 and filter on the months by using the drop-
down arrow in cell B3. The drop-down arrow in cell B1 enables you to filter the PivotTable so only
East or West sales data is used. Refresh updates the PivotTable based on data changes. Slicers and
timelines do not work with a PivotTable created from Multiple Ranges.

If you do not like the ALT+D+P combination, you can add the PivotTable And PivotChart Wizard
to the Quick Access toolbar by selecting File, Options, Quick Access Toolbar, and Commands Not
on the Ribbon and then selecting PivotTable and PivotChart Wizard.

To create a PivotTable from multiple ranges, the headings (in this case, January, February, and
March) in each range must be identical. Chapter 44 discusses a new feature in Excel 2013, the Data
Model, which enables you to create PivotTables even when a heading from one source range occurs
in none of the other source ranges.

How can I create a PivotTable based on an already created PivotTable?

Often, you want to create a PivotTable based on an already created PivotTable. This enables you to
view several PivotTables based on the same data. For example, a summary of makeup sales with each
salesperson’s name listed going down and product listed going across was created in the T ­ imeline.­xlsx
workbook (as shown in Figure 43-52). Suppose you also want to create a PivotTable with product
listed going down and salesperson going across. With the cursor in the PivotTable worksheet of work-
book Makeuptimeline.xls, press ALT+D+P to open the PivotTable And PivotChart Wizard. Choose
Another PivotTable or PivotChart Report. Choose the PivotTable from which you wish to build
your new table. The original PivotTable has been chosen: PivotTable10. Now the Field list appears, and
you can create a new PivotTable without disturbing your old table. Product has been put in the Row
area, Name in the Column area, and Dollars in the Values area. This creates the PivotTable shown in
Figure 43-62.

436  Chapter 43  Using PivotTables and slicers to describe data


FIGURE 43-62  Here is a PivotTable based on another PivotTable.

Problems
1. Contoso, Ltd. produces microchips. Five types of defects (labeled 1–5) have been known to
occur. Chips are manufactured by two operators (A and B), using four machines (1–4). You
are given data about a sample of defective chips, including the type of defect, the operator,
machine number, and day of the week the defect occurred. Use this data to chart a course of
action that would lead, as quickly as possible, to improved product quality. You should use
a PivotTable to stratify the defects with respect to type of defect, day of the week, machine
used, and operator working. You might even want to break down the data by machine, opera-
tor, and so on. Assume that each operator and machine made an equal number of products.
You’ll find this data in the Contoso.xlsx file.

2. You own a fast-food restaurant and have done some market research in an attempt to under-
stand your customers better. For a random sample of customers, you are given the income,
gender, and number of days per week that residents go out for fast food. Use this information
to determine how gender and income influence the frequency with which a person goes out
to eat fast food. The data is in the McDonalds.xlsx file.

3. Students at the School of Fine Art apply to study either English or Science. You have been
assigned to determine whether the School of Fine Art discriminates against women in admit-
ting students to the school of their choice. You are given the following data on the School of
Fine Art’s students:

• Female or male
• Major applied for: English (Eng) or Science (Sci)
• Admit? Yes or No
Assuming that women are as qualified for each major as men are, does this data indicate that
the college discriminates against women? Be sure you use all available information. The data is
in the Finearts.xlsx file.

4. You have been assigned to evaluate the quality of care given to heart attack patients at
Emergency Room (ER) and Chicago Hope (CH). For the past month, you are given the follow-
ing patient data:

Using PivotTables and slicers to describe data  Chapter 43   437


• Hospital (ER or CH).
• Risk category (high or low). High-risk people are less likely to survive than low-risk people.
• Patient outcome (live or die).
Use this data to determine which hospital is doing a better job of caring for heart attack
patients. Hint: Use all the data. The data is in the Hospital.xlsx file.

5. You are given the monthly level of the Dow Jones Index for years 1947 to 1992. Does this
data indicate any unusual seasonal patterns in stock returns? Hint: You can extract the month
(January, February, and so on) by using the TEXT(A4,”mmm”) formula copied to any column.
The data is in the Dow.xlsx file.

6. The Makeupdb.xlsx file contains information about the sales of makeup products. For each
transaction, you are given the following information:

• Name of salesperson
• Date of sale
• Product sold
• Units sold
• Transaction revenue
Create a PivotTable to compile the following information:

• The number of sales transactions for each salesperson.


• For each salesperson, the total revenue by product.
• Using your answer to the previous question, create a function that always yields Jen’s lip-
stick sales.

• Total revenue generated by each salesperson broken down by location.


• Total revenue by salesperson and year. (Hint: You need to group the data by year.)
7. For years 1985 to 1992, you are given monthly interest rates on bonds that pay money
one year after the day they’re bought. It’s often suggested that interest rates are more
volatile—tend to change more—when interest rates are high. Does the data in the Intratevol-
volatility.xlsx file support this statement? (Hint: PivotTables can display standard deviations.)

8. For the grocery example, prepare a chart that summarizes the trend over time of the sales at
each store.

9. For the grocery example, create a calculate field that computes an average per unit price
received for each product.

10. For the grocery example, create a PivotChart that summarizes the sales of each product at
each store for years 2005 and 2006.

438  Chapter 43  Using PivotTables and slicers to describe data


11. For the data in the Calcitemdata.xlsx file, create calculated items that summarize sales of des-
sert (cakes + puddings) and fruits (apples + grapes).

12. In the chip PivotTable example, create a PivotTable that summarizes monthly sales of Chips 1
and 3 in France and the United States.

13. In the customer PivotTable example, show the top 15 customers in one table and the bottom
5 customers in another table.

14. The Ptablepartsdata.xlsx file contains sales of various parts. Each part code begins with either
Part (for computer part) or Comp (for computer). Create a PivotTable that shows only sales of
Parts. (Hint: Use a labels filter.)

15. For the data in problem 14, summarize the total sales of parts and computers.

16. The Cigarettedata.xlsx file contains the age of a sample of Americans, whether they smoke
cigarettes or cigars, and whether they died during the current year. What can you conclude
from this data?

17. The Collegedata.xlsx file tells you the following information about students who applied to
graduate school at Kelley University: gender, desired major, whether accepted or rejected. If
you construct the appropriate PivotTable, you will find fewer women are accepted than men
are. Do you think Kelley discriminates against women?

18. The AnalyzeSurveydata.xlsx file contains answers on a 1–7 scale to various questions on a
teaching evaluation survey. Create a PivotChart that charts the fraction of the time each value
1–7 occurs for each question. Filter the chart to show the breakdown for any set of three ques-
tions you choose.

19. Using the data in the MonthtoMonth.xlsx file, create a PivotTable that shows how each
month’s sales differs from the previous month for the year 2010.

Using PivotTables and slicers to describe data  Chapter 43   439

You might also like