Sie sind auf Seite 1von 31

Microsoft Excel 2010 Step-by-Step Pivot Tables

Microsoft Excel 2010 Step-by-Step Exercises


PivotTables and PivotCharts: Exercise 1
In this exercise you will learn how to:

 Create a new PivotTable


 Add fields to a PivotTable
 Format and rename PivotTable fields
 Rearrange PivotTable fields
 Remove fields from a PivotTable

Introduction
These exercises are designed to help you learn how to build PivotTables and PivotCharts in
Microsoft Excel 2010. They will guide you step-by-step through the various processes whilst at the
same time explaining exactly what you are doing and why you are doing it.

The exercises use the file CommodityShipments (PivotTables PivotCharts).xlsx which you can
download from my web site at http://www.fontstuff.com/training/excel/stepbystep.htm

To get the greatest benefit from the exercises you should work through the steps on your own
computer using the sample file or files provided. You can work at your own pace. The steps are
numbered so if you want to take a break you can make a note of how far you have got and start
from the same place when you resume. Don’t forget to save your work if you close the file.

Each step of the process is labelled in bold, for example, Step 3:. Follow the instructions exactly
and do not leave any steps out. Occasionally you will see paragraphs labelled Try this:. These are
optional actions which help illustrate particular features. You can choose to follow these instructions
or not. This will not affect the progress of the exercise but will help you learn more about the topic.
It is also important that you do not do anything else in the exercise workbook whilst performing
the exercise, although you can work in other workbooks if you need to.

Between the various steps you will find text and screenshots explaining and illustrating what is
going on. You can choose to ignore this if you wish but you will learn more quickly if you
understand what you are doing and why, so I recommend that you read them.

Review the Data


Step 1: Start Excel then open the file Commodity Shipments (PivotTables and
PivotCharts).xlsx and take a look at the different worksheets.

The exercise file contains four worksheets:

 Commodity Shipments This worksheet contains a copy of the data that you will be
working with during the exercises.
 Pivot Table On this worksheet there is a PivotTable based on the data on the first
worksheet. There are also two Slicers. You will build a PivotTable just like this one.
 Pivot Chart This worksheet has a PivotChart in addition to a PivotTable and a pair of
Slicers. You will also build a PivotChart like this one.
 Exercise This worksheet has another copy of the data. It is exactly the same as the data
on the first sheet but, since you will be making some changes to it, I have supplied you
with a separate set of data.

There are 500 rows of data. Each row describes a shipment from one country to another. The year
and month of the shipment are shown, as well as the weight of the shipment in tonnes. Also shown
is the name of the country from which the shipment originated and the name of the destination
country. The shipments comprise a number of different commodities, mostly grains.

The rows of data are randomly arranged and not sorted into any specific order. This is to illustrate
that data does not have to be organised in a particular way for analysis with a PivotTable or
PivotChart. The only prerequisite is that the data is arranged in columns with a meaningful heading
at the top of each column.

©Martin Green www.fontstuff.com 1


Microsoft Excel 2010 Step-by-Step Pivot Tables

Create a PivotTable
Step 2: Go to the sheet named Exercise and select any cell in the data making sure that
you select only one cell, then go to the Insert tab and click the PivotTable button (Fig.
1).

Fig. 1 Go to the Insert tab and click the PivotTable button.

The Create PivotTable dialog box appears (Fig. 2) and Excel automatically selects the entire block
of data on the sheet and enters its address in the Table/Range textbox. When working with your
own data you should check that Excel has selected the correct data. If not, at this stage you can
manually select the data you want to analyse or enter its address in the textbox.

Note that the Create PivotTable dialog offers the option to Use an external data source (such as a
different workbook or an external database). This will be the subject of different exercise.

It also allows you to specify a location for the PivotTable, the default being a New Worksheet. If
you wanted to create the PivotTable on a specific worksheet you would select Existing Worksheet
(it must be an existing one because you can’t create a sheet whilst the dialog box is open). You
would then click in the Location textbox, navigate to the appropriate sheet and select the cell
where you wanted the PivotTable to start.

Fig. 2 Accept the default settings and click the OK button.

Step 3: In this exercise you are going to create a PivotTable on a New Worksheet so leave
that option selected and click the OK button.

Excel creates a new worksheet, here named Sheet1, to the left of the Exercise sheet and adds an
empty PivotTable to it (Fig. 3). Before starting to create the PivotTable take a look around the
workspace.

©Martin Green www.fontstuff.com 2


Microsoft Excel 2010 Step-by-Step Pivot Tables

Excel has added two new tabs to the ribbon under the heading PivotTable Tools. The tabs are
labelled Options and Design. You will use these later to customise your PivotTable. The Options tab
is selected and three buttons have been activated at its right-hand side. You will find out later what
these buttons do.

On the left side of the worksheet there is a rectangle containing some instructions and a diagram.
This is where the PivotTable will be created. Note that is shows the name of the PivotTable as
PivotTable 1. A PivotTable can be given a unique name which can be useful if it is to be
manipulated using macro (VBA) programming or interrogated using one of Excel’s PivotTable
functions.

On the right side of the worksheet is the Field List. This is where you do the basic design work to
create the PivotTable.

Fig. 3 Excel creates a new worksheet containing an empty PivotTable.

Try this: Click on any cell in the centre of the worksheet. See that the two PivotTable Tools
tabs and the Field List have disappeared. Remember that these tools will only be shown if the
PivotTable is selected. The text on the Pivot Table has also changed, instructing you to click it
to start building your PivotTable so click anywhere in the rectangle to bring back the ribbon
tabs and the Field List.

Try this: On the Options tab click the button marked Field List to deactivate it. See that the
Field List disappears but the PivotTable tabs remain. This button is used to hide the Field List
when it is not needed. Click the button again to bring back the Field List.

Step 4: In the PivotTable Field List click the checkbox next to CountryFrom.

This puts a tick in the checkbox and Excel places a button labelled with that field’s name in the Row
Labels box at the bottom of the Field List. It also starts to build the PivotTable by creating a list of
country names where the rectangle on the left of the window stood (Fig. 4).

Excel has scanned through the CountryFrom column of the data and returned a list of all the
unique items it found, and sorted them alphabetically.

©Martin Green www.fontstuff.com 3


Microsoft Excel 2010 Step-by-Step Pivot Tables

Note that at the top of the list there is a cell containing the text Row Labels. The cell also contains
a filter button. At the bottom of the list there is a cell containing the text Grand Total.

Fig. 4 Excel begins to build the PivotTable

Step 5: In the PivotTable Field List click the checkbox next to Tonnes.

This puts a tick in the checkbox and Excel places a button labelled with that field’s name in the
Values box at the bottom of the Field List. It has also added a column on numbers to the PivotTable
(Fig. 5).

Fig. 5 The Tonnes field is added to the PivotTable.

Excel deduced that the field you selected contained numerical values that it could calculate, so it
automatically added the field to the Values part of the PivotTable. It analysed the values it found
and summarised the data by the field that was already in the PivotTable. It labelled the new
PivotTable column Sum of Tonnes. Each number represents the total of the Tonnes values for each
country in the CountryFrom column of the data, and placed a grand total at the foot of the
PivotTable column.

Format the Numerical Data


Unformatted numbers are hard to read so let’s add some formatting to the Tonnes field…

Step 6: In the Values box of the PivotTable Field List click the down-arrow on the button
labelled Sum of Tonnes then choose Value Field Settings from the menu (Fig. 6).

Fig. 6 Select Value Field Settings.

This opens the Value Field Settings dialog box. Here you can customise the appearance of the
selected field. You can also specify what sort of calculation is performed. You could, for example,
choose Count so see the total number of shipments for each country, or display the Average size of
each country’s shipments. There are several other options that we will explore later.

©Martin Green www.fontstuff.com 4


Microsoft Excel 2010 Step-by-Step Pivot Tables

Step 7: In the Custom Name textbox of the Value Field Settings dialog, change the
field’s label to Total Tonnes.

Step 8: Click the Number Format button in the lower left corner of the Value Field
Settings dialog to open the Format Cells dialog and under Category click Number. Set
the Decimal places value to 0 and place a tick in the Use 1000 Separator checkbox
(Fig. 7).

Fig. 7 Specify a Custom Name and Number Format.

Step 9: Click OK to close the Format Cells dialog then click OK to close the Value Field
Settings dialog.

The numbers on the pivot table have now been formatted to the comma style with no decimal
places and the field label has changed to Total Tonnes (Fig. 8).

Fig. 8 Custom field settings have been applied.

Add a Second Field


Until now we have let Excel decide how to arrange the fields on the PivotTable, but you can easily
place the fields exactly where you want them.

Step 10: Point at the Commodity field button in the PivotTable Field List and drag it into
the Column Labels box (Fig. 9).

Fig. 9 Drag the Commodity field into the Column Labels box.

Excel has added the Commodity field to the PivotTable and created table of data in which the
Tonnes values have been recalculated to show the Totals for each exporting Country
(CountryFrom) by Commodity. As it did previously with the CountryFrom data, Excel has analysed
the Commodity data and identified all the unique items, then used each one as a label for the new
columns in the PivotTable (Fig. 10). It has also added a grand total for each row.
©Martin Green www.fontstuff.com 5
Microsoft Excel 2010 Step-by-Step Pivot Tables

Note that in order to accommodate the new headings the table has moved down the sheet a little
way. This is one of the reasons why it is a good idea when formatting PivotTable data to apply the
formatting the field using Value Field Settings, as you did earlier, rather than simply formatting the
cells.

Fig. 10 Excel has added the Commodity field to the PivotTable.

Note also that Excel has now placed a tick in the checkbox next to Commodity in the PivotTable
Field List, indicating that the Commodity field is currently represented in the PivotTable. The names
of fields included in the PivotTable are also shown in bold.

Removing and Moving Fields


There are two ways to remove a field from the PivotTable.

Step 11: Click the checkbox adjacent to Commodity in the PivotTable Field List to
remove the tick from the box.

As you would expect the PivotTable returns to its previous appearance as shown in Fig. 8.

Step 12: Click the Commodity checkbox so that it is ticked again.

Excel restores the Commodity field to the PivotTable but this time it has decided to place it in the
Row Labels box below the CountryFrom field. Although the same fields are being displayed in the
PivotTable its appearance is now quite different. The calculated values from the Tonnes field are
the same as before, just displayed in a different way. The Total Tonnes of each Commodity are
now shown for each CountryFrom.

Fig. 11 The Commodities are shown below each Country.

Step 13: Go back to the PivotTable Field List and in the Row Labels box drag the
CountryFrom button downwards and drop it underneath the Commodity button.

Again Excel rearranges the PivotTable so that the Total Tonnes of each CountryFrom are now
shown for each Commodity (Fig. 12). These few examples are beginning to illustrate the power of
Excel’s PivotTable tool.

©Martin Green www.fontstuff.com 6


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 12 The Countries are shown below each Commodity.

When data is shown this way it is said to be grouped. Currently (Fig. 12) the CountryFrom data is
grouped by Commodity. Previously (Fig. 11) the Commodity data was grouped by CountryFrom.

When data is grouped like this Excel places a small button containing a minus sign next to each
group item. This is used to group and ungroup the field items.

Step 14: Click each of the minus buttons to collapse each of the Commodity groups.

As you do this Excel recalculates the Tonnes values and displays a total for each group (Fig. 13)
and each minus sign is replaced by a plus sign.

Fig. 13 The Commodity Groups have been collapsed to show totals.

Step 15: Click each of the plus buttons to expand each of the Commodity groups.

The PivotTable now shows all the data again. Here’s another way to remove a field from the
PivotTable…

Step 16: In the PivotTable Field List drag the Commodity button out of the Row Labels
box into an empty space (such as over the worksheet) so that a cross appears next to the
mouse pointer, then release the mouse button.

Fig. 14 Drag the Commodity button into a space.

Conclusion
This concludes Exercise 1. The next exercise will continue from this point so if you wish to proceed
to the next exercise you should save the file in its current state.

©Martin Green www.fontstuff.com 7


Microsoft Excel 2010 Step-by-Step Pivot Tables

Microsoft Excel 2010 Step-by-Step Exercises


PivotTables and PivotCharts: Exercise 2
In this exercise you will:

 Add a field to the PivotTable


 Create custom labels for rows and columns
 Apply manual grouping to a PivotTable field
 Create custom labels for groups

Introduction
This exercise assumes that you have completed the steps in Exercise 1 and continues from the
point where you saved the workbook after Step 16. If you didn’t save your work, or wish to omit
Exercise 1, you can download a copy of the completed Exercise 1 workbook CommodityShipments
(PivotTables PivotCharts).xlsx from my web site at
http://www.fontstuff.com/training/excel/stepbystep.htm

The Project So Far


In Exercise 1 you created a new PivotTable, renamed and formatted one of its fields, and found out
how to add, rearrange and remove PivotTable fields. The PivotTable was created on a new
worksheet, Sheet1 in this example, and currently includes just two fields: CountryFrom and
Tonnes. In the PivotTable Field List the CountryFrom field is located in the Row Labels box and the
Tonnes field is located in the Values box where is shown a Total Tonnes (because in Exercise 1 it
was given that name). The PivotTable worksheet currently looks like this (Fig. 1):

Fig. 1 The worksheet created in Exercise 1.

Add a Field to the PivotTable


Continuing where Exercise 1 left off, you are now going to add more data to the PivotTable.
©Martin Green www.fontstuff.com 1
Microsoft Excel 2010 Step-by-Step Pivot Tables

Step 17: In the PivotTable Field List click the checkbox next to CountryTo.

Excel places the CountryTo field into the Row Labels box, immediately below the CountryFrom field,
and the PivotTable now displays the various country names it finds in the CountryTo column of the
data beneath each of the countries from the CountryFrom column (Fig. 2).

Fig. 2 Add the CountryTo field to the PivotTable.

Note: You might have noticed the one of the cells in the PivotTable is selected (in this
example the cell containing the text Italy). This isn’t significant, it just happens to be the
cell that was selected when the new field was added.

Step 18: In the PivotTable Field List go to the Row Labels box, click the down-arrow on
the button labelled CountryTo and choose Move to Column Labels from the menu (Fig.
3).

Fig. 3 Move the CountryTo field to ColumnLabels.

The PivotTable responds accordingly, moving the names from the CountryTo column so that they
are arranged in a row at the top of the PivotTable, each at the head of a column (hence the name
Column Labels) (Fig. 4).

Try this: You don’t have to use the menu when moving fields around the PivotTable Field
List. If you prefer, you can simply drag the field button from box to box. Try swapping the
positions of the two label fields by dragging the CountryTo button back to the Row Labels
box then dragging the CountryFrom button into the Column Labels box. Return them to
their previous positions before moving to the next step.

©Martin Green www.fontstuff.com 2


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 4 The CountryTo field has been added to the PivotTable.

Tidy-up the Table


At this point the table looks a little untidy. The columns are of different widths because Excel has
sized the columns automatically to fit their contents. So, the country with the shortest name (Italy)
has a narrow column and the one with the longest name (United Kingdom) has a wide column. The
table would look neater if the CountryTo columns were all the same width.

Making all the columns the same width as the widest one would waste space, but we don’t want to
cut off any text so instead we will abbreviate the label for the United Kingdom column to UK.

Step 19: Select the cell containing the heading United Kingdom, type UK and press
[Enter].

Step 20: Select columns C to K by dragging the mouse pointer along the buttons at the head
of the columns. Release the mouse then point at the line dividing the column buttons K and
L so that the mouse pointer changes to a cross with a horizontal two-headed arrow. Now
drag to the right until the column width shows about 90 pixels (Fig. 5).

Fig. 5 Make the columns the same width.

When you release the mouse, all the selected columns will snap to the same width (this might
require a little trial-and-error!).

The PivotTable might look better with the column labels right-aligned in their cells, so…

Step 21: Select the cells B4:K4 and click the Align Text Right button on the Home tab of
the ribbon.

You have seen how you can change a label that Excel automatically added to the PivotTable by
simply overtyping it. Now use the same technique to add more sensible captions to the cells
marked Column Labels and Row Labels.

Step 22: Select cell B3 which currently holds the text Column Labels and type Destination.

Step 23: Select cell A4 which currently holds the text Row Labels and type Exporter.

Now the PivotTable looks neater, with equal column widths and more meaningful captions (Fig. 6).

©Martin Green www.fontstuff.com 3


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 6 The PivotTable has been reformatted.

You might be wondering what happens if you rearrange the fields after making these changes.
Let’s find out…

Step 24: Go to the PivotTable Field List and rearrange the fields, putting CountryTo in
the Row Labels box and CountryFrom in the Column Labels box.

Here’s the result (Fig. 7). When the fields were rearranged, the PivotTable remembered that the
heading United Kingdom had been changed to UK and that the CountryTo names had been right-
aligned. But the cells previously labelled Column Labels and Row Labels still hold the values they
were changed to (Destination and Exporter) which are now incorrect.

Fig. 7 The PivotTable keeps some changes but not others.

It is important to remember, therefore, that it if you want to make cosmetic changes like this it
might be better to wait until the PivotTable is finished.

Step 25: Restore the fields to their previous positions so that the CountryTo field is in the
Column Labels box and the CountryFrom field is in the Row Labels box.

You will notice that Excel has again auto-fitted the column widths so, if you wish, you can repeat
the process you used earlier to make them equal in width.

Manually Grouping Fields


In Exercise 1 you saw how Excel automatically grouped fields so that you could expand or contract
the groups to show or summarise data. If you have appropriate data you can add manual grouping
to a PivotTable. Consider the list of exporting countries that make up the CountryFrom field. They
can be grouped geographically.

You could, for example, group Argentina, Brazil and Mexico together, and separately group USA
and Canada.

In order to manually group rows or columns in a PivotTable all the members of a group must be
adjacent to one another so they can be selected as a block. You cannot group a multiple selection
of rows or columns. In this PivotTable we only need to move one field (Mexico) up one row so that
is adjacent to the other fields in its group (Argentina and Brazil). That also brings Canada adjacent
to the other member of its group (USA).

Step 26: Move the mouse pointer over cell A8 (Mexico), slightly left of centre, so that it
changes to a black, right-facing arrow and click to select that row of the PivotTable (Fig. 8).

Step 27: Move the mouse pointer to the upper edge of the black box that borders the
selection so that it displays a four-headed arrow then drag upwards. As you do so Excel

©Martin Green www.fontstuff.com 4


Microsoft Excel 2010 Step-by-Step Pivot Tables

displays a grey bar where the selection will move to when the mouse is released. Release
the mouse when the bar is between the rows for Canada and Brazil (Fig. 8).

Fig. 8 Drag the Mexico row up the PivotTable.

Step 28: Select the cells A5:A7 (containing the labels Argentina, Brazil and Mexico) then go
to the Options tab on the PivotTable Tools section of the Ribbon and click Group
Selection (Fig. 9).

Fig. 9 Group the selected PivotTable rows.

You will see that the PivotTable looks a bit strange at this point. This is because only some of the
countries were grouped. The selected countries (Argentina, Brazil and Mexico) have now been
grouped together under the heading Group1 but the remaining countries (Canada and USA) are
each in a group of their own. We now have to group the remaining countries to get the effect we
want.

Step 29: Select cells A9:A12 (alternatively select cell A10 then hold down the [Ctrl] key
whilst you select cell A12) then click Group Selection.

The PivotTable now shows the exporting countries in two groups, labelled Group1 and Group2 (Fig.
10). The next task is to give the groups meaningful names.

Fig. 10 The exporting countries are shown in two groups.

Step 30: Select cell A5 (currently displaying the text Group1) then type South America and
press [Enter].

©Martin Green www.fontstuff.com 5


Microsoft Excel 2010 Step-by-Step Pivot Tables

Step 31: Select cell A9 (currently displaying the text Group2) then type North America and
press [Enter].

Step 32: Double-click the line separating the buttons at the top of columns A and B to snap
column A to the correct width to display the new text.

The PivotTable now shows the exporting countries grouped under their new group names (Fig. 11).

Fig. 11 The groups now show their new group names.

Now that we have defined groups for the data the PivotTable can easily summarise the data by
those groups. Adjacent to each group name is a small box containing a minus sign.

Step 33: Click the minus signs next to each of the group headings (South America and North
America).

This collapses each group, at the same time summarising its data and displaying the totals in the
same rows as the group names (Fig. 12).

Fig. 12 Collapse the groups to display their totals.

The minus signs adjacent to each group name have changed to plus signs indicating that there is
data hidden.

Step 34: Click the plus signs nest to each of the group headings (South America and Noth
America) to expand the groups and display their component country data.

NOTE: Take a look at the PivotTable Field List. You will see a new item, CountryFrom2, has
appeared in both the list of data fields and in the Row Labels box. This represents the
groupings you applied to the CountryFrom field. If you were to remove this item from the Row
Labels box, or uncheck it in the Field List, the grouping of the CountryFrom field would be
removed from the PivotTable.

Conclusion
This concludes Exercise 2. The next exercise will continue from this point so if you wish to proceed
to the next exercise you should save the file in its current state.

©Martin Green www.fontstuff.com 6


Microsoft Excel 2010 Step-by-Step Pivot Tables

Microsoft Excel 2010 Step-by-Step Exercises


PivotTables and PivotCharts: Exercise 3
In this exercise you will:

 Nest fields in the PivotTable


 Experiment with the layout of PivotTable fields
 Apply some PivotTable Options
 Expand and collapse groups

Introduction
This exercise assumes that you have completed the steps in Exercise 2 and continues from the
point where you saved the workbook after Step 34. If you didn’t save your work, or wish to omit
the previous exercises, you can download a copy of the completed Exercise 2 workbook
CommodityShipments (PivotTables PivotCharts).xlsx from my web site at
http://www.fontstuff.com/training/excel/stepbystep.htm

The Project So Far


In Exercise 2 you added a field to the PivotTable, experimented with custom labels and added
grouping to the CountryFrom field. The elements of the CountryFrom field make up the Row Labels
and are divided into two groups, South America and North America. The elements of the CountryTo
field make up the Column Labels. The main captions for the Row Labels and Column Labels have
been changed to Exporter and Destination respectively. Where the fields intersect the Values
represent Total Tonnes being the total tonnage of shipments made during the period of the data.
The PivotTable worksheet currently looks like this (Fig. 1):

Fig. 1 The PivotTable created in Exercise 2.

©Martin Green www.fontstuff.com 1


Microsoft Excel 2010 Step-by-Step Pivot Tables

Adding a Third Field


When a PivotTable contains only two fields the most obvious arrangement is to show the elements
of one field across the worksheet (as Column Labels) and those of the other field down the
worksheet (as Row Labels), forming a grid in which the intersecting elements can display a value.
Where, then, would you display a third (or fourth or more) field? One way to do this is to “nest” the
field inside one of the existing ones. Let’s see how this works…

Step 35: In the PivotTable Field List click the checkbox next to Year to place a tick in it.

Excel places the field in the Values box and labels it Sum of Year. This is obviously the wrong place,
but Excel saw that the column of data consisted entirely of numbers and therefore assumed that it
was a numerical value to be calculated. Let’s move it to a more suitable place.

Step 36: In the PivotTable Field List, drag the button marked Sum of Year from the
Values box to the Row Labels box and drop it underneath the CountryFrom button.

Note: Instead of dragging you could have clicked the down-arrow on the Sum of Year button
and choose Move to Row Labels from the menu.

Excel changes the button’s caption to Years indicating that its values are no longer being
calculated. Your PivotTable probably doesn’t look any different yet because at the end of the last
exercise we left the groups collapsed (i.e. showing only the group headings). If that is the case…

Step 37: Click the plus buttons adjacent each group heading (South America and North
America) to expand the groups and reveal their contents.

Now you can see how the PivotTable has included the Year field, showing a Total Tonnes value for
each Year for each CountryFrom (Fig. 2). The Year field is shown nested inside the CountryFrom
field.

Fig. 2 The Year field is nested inside the CountryFrom field.

Alternatively you could have the PivotTable show a Total Tonnes value for each CountryFrom for
each Year. Do this simply by changing the arrangement of the fields in the PivotTable field List.

Step 38: Click the down-arrow on the Year button in the Row Labels box and choose Move
Up from the menu.

Note: Instead of using the menu you could drag the Year button and drop it above the
CountryFrom button.

Now the CountryFrom field is nested inside the Year field (Fig. 3).

©Martin Green www.fontstuff.com 2


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 3 The CountryFrom field is nested inside the Year field.

When dealing with multiple fields in a PivotTable the placement of fields in the PivotTable Field List
dictates the layout of the PivotTable. As long as you choose an arrangement that is logical (unlike
that when Excel decided to put the Year field in the Values box) you can use whatever arrangement
suits your purpose or presents your data in the most pleasing way.

Try this: Experiment with different arrangements of fields. Move the Year field from the
Row Labels box to the Column Labels box. The same data is displayed but in a different
way, making the PivotTable very wide. Now move the CountryTo field from the Column
Labels box to the Row Labels box. Again the appearance of the PivotTable changes.
Return the fields to their former locations with Year above CountryFrom in the Row Labels
box and CountryTo in the Column Labels box.

When fields are nested in a PivotTable, Excel displays subtotals for all but the innermost of the
nested fields. For example, when Year was nested inside CountryFrom, (Fig. 2) individual values
were shown for each Year with a subtotal for each CountryFrom. When CountryFrom was nested
inside Year individual values were shown for each CountryFrom with a subtotal for each Year.

Try this: Place a tick in the checkbox next to Commodity in the PivotTable Field List. Excel
adds this field to the Row Labels box so that it is nested inside CountryFrom. Take a look at
the values. Individual values are shown for each Commodity and subtotals are shown for
CountryFrom and Year. Remove the Commodity field by unchecking the box or by clicking
the down-arrow on its button and choosing Remove Field from the menu.

PivotTable Options: Show Empty Cells as Zeroes


Excel offers a wide range of options for how the PivotTable’s data is displayed. Let’s change a
couple of them.

When plotting one field against another, it is possible that there is no data for a particular
combination of field elements. For example, in this set of data there were no shipments from
Mexico to Belgium in the year 2006. The default in such an event is to leave the cell empty. As a
result the cell where these two columns intersect (cell B9) is blank. Excel allows you to enter any
value of your choice into such cells.

Step 39: Go to the Options tab of the PivotTable Tools section of the Ribbon and click the
Options button (at the left end of the Ribbon). On the Layout & Format tab of the
PivotTable Options dialog box make sure there is a tick in the checkbox next to For
empty cells show: and type a zero (0) in the textbox next to it. Click the OK button to
confirm your instruction and close the dialog box.

Now all the cells in the Values section of the PivotTable that contain no data show a zero (Fig. 4).

Note: This may or may not be a desirable thing to do depending upon the nature of your
data. There is a difference between there being a value of zero (we know we didn’t make
any shipments that year) and there being an absence of data (we don’t know whether or
not we made any shipments because we don’t have that year’s data). However, on a
PivotTable it makes no difference to the calculations because the results it displays are
based on the source data (and any filters that may have been applied) and not necessarily

©Martin Green www.fontstuff.com 3


Microsoft Excel 2010 Step-by-Step Pivot Tables

on what you can see on the PivotTable. Take a look at the data (Fig. 4) for South America,
2006, Belgium. The values displayed are 7,587 (Argentina), 7,453 (Brazil) and 0 (Mexico).
If these three values were calculated on a regular worksheet the Sum of the three cells
(15,040) would be the same regardless of whether or not the Mexico value was a zero or
an empty cell, because when calculating a Sum Excel treats an empty cell as zero. But if
Excel were calculating an Average there would be a difference. The average of the three
cells 7,587, 7,453 and 0 would be 5,013 but if instead of the cell containing a zero it were
blank the Average would be 7,520, because when calculating an Average Excel ignores
empty cells. However, if you were to change the Value Field Settings for the Tonnes field
from Sum to Average you would see that the result displayed on the PivotTable would be
the same whether the cells contained zeroes or were left empty. This shows that the
PivotTable is calculating the source data and not necessarily what you see on screen.

Fig. 4 The empty cells now contain zeroes.

PivotTable Options: Show Group Subtotals


Now that the PivotTable has groups, notice that in addition to the grand totals at the foot of the
table, Excel has added subtotals to the innermost (Years) group values. The outer group values
(South America and North America) do not initially show subtotals. When groups are collapsed
Excel automatically shows subtotals for each grouping level but if you want all these subtotals to be
displayed when the groups are expanded you need to ask for them. Here’s how…

Step 40: Go to the Design tab of the PivotTable Tools section of the Ribbon, click the
button marked Subtotals in the Layout group, then choose Show all Subtotals at Top
of Group (Fig. 5).

Fig. 5 Ask Excel to display Subtotals.

Now in addition to the Year subtotals the PivotTable displays subtotals for the major group (South
America and North America) (Fig. 6).

©Martin Green www.fontstuff.com 4


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 6 The PivotTable displays subtotals for all the grouping levels.

Expanding and Collapsing Groups


As you have already seen, you can collapse or expand a group by clicking the plus or minus
buttons adjacent to the group member’s name. Doing this allows you to hide or show the contents
of individual group members but if you want to do this for the whole group there’s an easier way.
In fact, as usual with Excel, there’s more than one way. Take your choice…

Step 41: Right-click on one of the Year numbers in the leftmost column of the PivotTable
then point to Expand/Collapse and choose Collapse Entire Field from the submenu
(Fig. 7).

Fig. 7 Collapse the entire field.

In one step Excel collapses all the members of the Year field to display only their subtotals (Fig. 8).

Fig. 8 The Year field has been collapsed.

If you had instead right-clicked on, for example, South America and given the same instruction
then that field would have collapsed and only the subtotals for South America and North America
would show.

Step 42: Right-click on one of the Year numbers in the leftmost column of the PivotTable
then point to Expand/Collapse and choose Expand Entire Field from the submenu.
©Martin Green www.fontstuff.com 5
Microsoft Excel 2010 Step-by-Step Pivot Tables

This returns the PivotTable to its previous state with all the data on show. Now let’s try doing it a
different way…

Step 43: With one of the Year numbers selected, go to the Options tab of the PivotTable
Tools section of the Ribbon, and click the Collapse Entire Field button in the Active
Field group (Fig. 9).

Fig. 9 Click the Collapse Entire Field button.

All the members of the Year group have been collapsed. Notice that the selection has not changed.

Step 44: Click the Collapse Entire Field button in the Active Field group again.

Although the selected cell contained a member of the Year group, since that group was already
collapsed, Excel collapsed the next group above it to return the PivotTable to the condition it was in
at the start of this exercise (Fig. 1).

Note: Both the right-click menu and the ribbon offer Expand Entire Field commands to
reverse the process.

You might be wondering what would happen if you tried to expand or collapse a field that wasn’t
grouped.

Try this: Select one of the Value field cells in the centre of the PivotTable. You will see
that the Collapse and Expand buttons on the Ribbon are disabled because Excel does not
know which field you might want to expand or collapse. Right-click the cell. See that the
Expand/Collapse option does not appear on the right-click menu.

Step 45: Select one of the country names (such as Germany) and either by right-clicking or
using the Ribbon button ask Excel to Expand Entire Field. Excel doesn’t know exactly
what you want to do but it offers you a list of fields to choose from (Fig. 10). You can
probably guess what would happen if you chose an existing field so choose Month, a field
we haven’t included yet, and click OK.

Fig. 10 Excel asks which field you want to expand.

Because the Month field wasn’t already shown on the PivotTable Excel added it and expanded it
(Fig. 11) and, since we had previously asked for subtotals to be shown it also added subtotals for
the Month field.

©Martin Green www.fontstuff.com 6


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 11 Excel added the Month field and inserted subtotals for it.

Conclusion
This concludes Exercise 3. In this exercise you have learned how to rearrange fields on the
PivotTable, to apply PivotTable options to show group subtotals and to display zeroes in empty
cells, and discovered different ways to expand and collapse groups to show or hide information on
the PivotTable. The next exercise will continue from this point so if you wish to proceed to the next
exercise you should save the file in its current state.

©Martin Green www.fontstuff.com 7


Microsoft Excel 2010 Step-by-Step Pivot Tables

Microsoft Excel 2010 Step-by-Step Exercises


PivotTables and PivotCharts: Exercise 4
In this exercise you will:

 Use PivotTable Filters to control which data is displayed


 Filter the PivotTable using Slicers
 Customise Slicers to create a user-friendly Dashboard

Introduction
This exercise assumes that you have completed the steps in Exercise 3 and continues from the
point where you saved the workbook after Step 45. If you didn’t save your work, or wish to omit
the previous exercises, you can download a copy of the completed Exercise 3 workbook
CommodityShipments (PivotTables PivotCharts).xlsx from my web site at
http://www.fontstuff.com/training/excel/stepbystep.htm

The Project So Far


In Exercise 3 we increased the complexity of the PivotTable by adding another field, and
experimented with layout, grouping and nesting of fields. The PivotTable displays the total tonnage
of shipments made between a number of countries in North and South America to a number of
countries in Europe. The exporting countries are listed in the first column of the PivotTable,
grouped by region (North America and South America) and by Year, the latter group being
collapsed so that the individual exporting countries are not shown. The top two rows of the
PivotTable show the names of the destination countries and the month of the shipment. The
PivotTable worksheet currently looks like this (Fig. 1):

Fig. 1 The PivotTable created in Exercise 3.

©Martin Green www.fontstuff.com 1


Microsoft Excel 2010 Step-by-Step Pivot Tables

Applying Filters
As you can see, the PivotTable is beginning to get crowded, and we haven’t included all the
available fields yet. One way to simplify things is to filter the data so that the PivotTable displays
only that data that we are interested in at any time. Excel offers several ways to do this.

Step 46: Go to the Column Labels box on the PivotTable Field List and drag the Month
button into the Report Filter box.

Note: Alternatively, you could click the down-arrow on the Month button and choose
Move to Report Filter from the menu.

In case you were wondering why Excel didn’t start the PivotTable in the first row of the worksheet,
here’s why. In the upper left corner of the worksheet Excel has created a Report Filter using the
Month field (Fig. 2). It currently shows (All) indicating that data for all the available values in the
Month field is being displayed.

Fig. 2 Excel has created a Report Filter for the Month field.

If you have used worksheet filters in Excel before you will be familiar with this tool. Let’s filter the
PivotTable to show the data for a chosen month.

Step 47: Click the down arrow on the filter button (to the right of (All)). Excel displays a list
of the unique items it finds in the Month field. Place a tick in the checkbox marked Select
Multiple Items so that each item is given its own checkbox. Click the checkbox next to
(All) to deselect all the checkboxes then click on 1 to place a tick in the checkbox for
month 1. Click the OK button to apply the filter (Fig. 3).

Fig. 3 Apply a filter to the Month field.

The Report Filter now shows the number 1 and a small filter icon to indicate that the PivotTable is
currently displaying filtered data for the value 1 in the Month field. The data on the PivotTable has
changed accordingly (Fig. 4).

©Martin Green www.fontstuff.com 2


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 4 The PivotTable is now displaying filtered data.

The Report Filter tool allows you to choose more than one item from the list…

Step 48: Open the Report Filter by clicking the button that now shows a down arrow and a
filter icon and place ticks in the checkboxes for months 2 and 3, then click OK to apply the
filter (Fig. 5).

The PivotTable data is now filtered to show the values for months 1, 2 and 3. The text on the
Report Filter button now reads (Multiple Items) indicating that the PivotTable is now displaying
data filtered by more than one value in the Month field (Fig. 5).

Fig. 5 Filtering by multiple values of a field.

If we had left the Month field in the PivotTable and kept it visible, it would be clear which items
have been filtered for, but since we removed that field earlier we now have a problem. Unless we
open the Report Filter and take a look we can’t see the filter values simply by looking at the
PivotTable. Fortunately, we have a fix for that which we will come to in a little while.

In the meantime let’s include another field in the filter. This time we will use a different method to
apply the filter. Take a look at the upper section of the PivotTable Field List. Note that adjacent to
the Month field entry there is now a filter icon indicating that the PivotTable is filtered by that field.

Try this: Point at the filter icon adjacent to the Month field in the upper part of the
PivotTable Field List so that a down arrow appears and click it. Excel displays a filter tool
identical to the one you just used for the Report Filter. The tool shows which values are
currently chosen and allows you to make changes if you wish. Click the Cancel button to close
the filter tool without making any changes.

Excel allows you to apply a filter directly from the PivotTable Field List.

Step 49: Point at the Commodity field in the upper part of the PivotTable Field List and
click the down arrow that appears to open the filter tool. Click the checkbox next to
(Select All) to deselect all the items then place a tick in the checkbox for Soybeans. Click
OK to close the filter tool and apply the filter.

Now that a filter has been applied to the Commodity field a filter icon appears against its entry in
the upper part of the PivotTable Field List (Fig. 6). This is the only indication that the data
displayed in the PivotTable has been filtered by the Commodity field.

©Martin Green www.fontstuff.com 3


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 6 Filter icons indicate which fields have filters applied.

If the PivotTable Field List were not visible then there would be no indication at all that a filter had
been applied to the Commodity field. Another problem! But again there is an easy way to deal with
it…

Step 50: Go to the PivotTable Field List and drag the Commodity field into the Report
Filter box.

The Report Filter in the upper left corner of the worksheet now includes the Commodity field (Fig.
7). It also shows that the data has been filtered for Soybeans. The PivotTable itself has moved
down the worksheet one row to accommodate the new item in the Report Filter. If more than one
item had been chosen from the Commodity field the Report Filter would show (Multiple Items) as it
does for the Month field.

Fig. 7 Adding the Commodity field to the Report Filter.

The ability to filter the data displayed in a PivotTable is a useful and important feature but, as you
have seen, it is not ideal. In fact, it has probably been retained in recent versions of Excel to
maintain compatibility with earlier versions of the program. Now we have a much more user-
friendly tool, the Slicer.

Adding Slicers
The slicer is a user-friendly tool that facilitates the filtering of PivotTable data whilst giving a visual
indication of the values making up the filter.

Note: Until now we have been filtering fields that were not otherwise displayed in the
PivotTable. This does not have to be the case. There is no reason why you should not apply a
filter to any field, whether separately visible on the PivotTable or not.

Step 51: Go to the Options tab of the PivotTable Tools section of the Ribbon and in the
Sort & Filter group click the Insert Slicer button to open the Insert Slicer dialog box.
Click the checkboxes next to Month and Commodity to place a tick in each then click OK
(Fig. 8).

Fig. 8 Adding slicers to the PivotTable.

©Martin Green www.fontstuff.com 4


Microsoft Excel 2010 Step-by-Step Pivot Tables

Excel has added two slicers to the worksheet. As you can see, a Slicer is a form of dialog box that
performs the same function as the Report Filter, but with a friendlier user interface. There is one
Slicer for each of the specified fields, the name of the field being shown at the top. As with the
Report Filter, each Slicer presents you with a list of the unique items it finds in its field, arranged in
alphabetical order. Each item is in the form of a button which is shown highlighted when the Slicer
is applying a filter for that item. You can see that, because we had already applied a filter to the
PivotTable, the Month Slicer has months 1, 2 and 3 highlighted, and the Commodity Slicer has
Soybeans highlighted (Fig. 9).

Fig. 9 Excel created a separate Slicer for each specified field.

Note: Although in this exercise you created Slicers for field that had already been filtered using
the Report Filter tool, you do not have to work this way. To filter the data on a PivotTable you
can use the Report Filter or a Slicer or both, whichever method you prefer.

Step 52: Go to the PivotTable Field List and drag the Commodity button from the Report
Filter box to an empty space on the worksheet (Fig. 10). Do the same with the Month
button.

Fig. 10 Drag the Commodity button into an empty space.

Doing this removes the two fields from the Report Filter section of the worksheet but leaves the
Slicers we added intact.

Using a Slicer
The usual rules for selecting items apply when using a Slicer. Here are some examples:

Step 53: On the Commodity Slicer click on Barley.

Now Barley is selected instead of Soybeans and the PivotTable data changes accordingly. Selecting
a single item like this automatically de-selects any other items on the same Slicer.

Step 54: Hold down the [Shift] key and on the Commodity Slicer click on Rice.

Now Barley, Maize and Rice are all selected and the PivotTable data changes accordingly. To select
a number of adjacent items on the Slicer, select the first item then hold down the [Shift] key whilst
clicking on the last one.

Step 55: Hold down the [Ctrl] key and on the Commodity Slicer click on Wheat.

This adds Wheat to the existing selection and the PivotTable data changes accordingly. When
selecting non-adjacent items on the Slicer, hold down the [Ctrl] key whilst clicking on each
additional item.

©Martin Green www.fontstuff.com 5


Microsoft Excel 2010 Step-by-Step Pivot Tables

In the upper-right corner of the Slicer, to the right of the name of the field to which it applies, is a
button with an icon of a filter and a red cross. This is used to clear the filter.

Step 56: Click the Clear Filter button on the Commodity slicer (Fig. 11).

Fig. 11 Clearing the Slicer’s filter.

When you clear a Slicer’s filter it removes any filter rules that were applied and selects all the
buttons on the Slicer to indicate that all available data for that field is being shown on the
PivotTable. In addition, the Clear Filter button is then disabled (greyed-out). The enabling and
disabling of the Clear Filter button confirms whether or not any filter is applied on that Slicer even
if you cannot see all of its buttons.

Removing a Slicer
You can also clear a filter from the PivotTable by removing the Slicer itself (as long as you do not
have a Report Filter in place for the same field).

Step 57: Right-click on the Month Slicer and choose Remove “Month” from the menu.

Note: If at first you get a different menu then click somewhere else on the Slicer and try
again. You can also remove a Slicer by selecting it and pressing the [Delete] key.

When you removed the Month slicer the data on the PivotTable changed again because its removal
also cleared the filter from the Month field. However, if a filter was being applied by a Slicer when it
is removed Excel remembers the filter settings for that field even though it ceases to apply them.

Try this: take a look at the PivotTable Field List (click on the PivotTable if it is not visible).
Notice that there is a filter icon adjacent to the Month field entry in the list. Point at the filter
icon and click the down arrow that appears. When you do this a filter tool opens showing the
same selection of items that were selected on the Slicer when you removed it. There is also an
option to Clear Filter From “Month”. Leave that as it is. Click Cancel to close the filter tool.
Now go to the ribbon and ask for a Slicer for the Month field. When the Month slicer returns it
has the same items selected as before and immediately applies the filter to the PivotTable.
This shows that when a Slicer is removed, Excel remembers any filter that it was applying at
the time and re-applies it if the Slicer is reinstated. Remove the Month slicer as you did
before so that only the Commodity Slicer remains.

Before moving on to the next section we will make a change to the PivotTable…

Step 58: Go to the PivotTable Field List and in the Row Labels box click the down arrow
on the Year button and choose Remove Field from the menu.

Step 59: Go to the Options tab of the PivotTable Tools section of the Ribbon, click the
Insert Slicer button, select the Year and CountryFrom fields and click OK.

Customizing Slicers
As well as providing an easy and user-friendly way of applying filters to a PivotTable, Slicers give a
visual indication of which data is being displayed even when the fields themselves are not included
in the PivotTable. Using Slicers you can start to build your PivotTable into a powerful Dashboard for
presenting your business data.

You can use the same methods to move and arrange Slicers as you would any other object (such
as a drawing or a chart). Move a Slicer by dragging it by its title bar, or select the Slicer by clicking
on it then use the [Arrow] keys on your keyboard to move it up, down, left or right on the
worksheet.
©Martin Green www.fontstuff.com 6
Microsoft Excel 2010 Step-by-Step Pivot Tables

Notice that when a Slicer is selected the PivotTable Field List disappears along with the PivotTable
Tools section of the Ribbon. Instead a Slicer Tools section appears with its own Options tab
showing a range of tools specific to Slicers.

Step 60: Arrange the Year, CountryFrom and Commodity slicers in a row below the
PivotTable. Select all three slicers by clicking on the first and holding down [Ctrl] whilst
clicking on each of the others then on the Options tab of the Slicer Tools section of the
ribbon click Arrange then Align Top. Click Arrange again and choose Distribute
Horizontally.

You now have the three Slicers neatly arranged and aligned with each other (Fig. 12).

Fig. 12 The PivotTable with three Slicers.

A range of colour schemes can be applied to Slicers, to match or contrast with that of PivotTable.
The available colour schemes are shown on the Slicer Schemes section of the Slicer Tools, Options
tab of the Ribbon. Each style has a name and you can define a style of your own if required. The
current style is shown highlighted. Simply click on another to apply it (Fig. 13).

Fig. 13 Applying a style to a Slicer.

Step 61: Click on the Title Bar of one of the Slicers to select it and go to the Slicer Styles
section of the Slicer Tools, Options tab of the Ribbon. Click the lower down arrow of the
Slicer Styles box to display a wider range of styles, then click on one to apply the style to
the selected Slicer. Repeat with the other Slicers (Fig. 14).

©Martin Green www.fontstuff.com 7


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 14 Different styles applied to Slicers.

In addition to the cosmetic changes that can be made to Slicers, a number of options are available
to control how they behave in use. The following steps demonstrate the usefulness of some of
these.

Step 62: On the Year Slicer click on 2006 then on the Commodity Slicer click on
Soybeans.

As you made your selections the PivotTable changed to reflect the filters you just applied. You will
also see two features of Slicers over which you have some control (Fig. 15).

Fig. 15 Using Slicers to filter for 2006 and Soybeans.

Notice that on the CountryFrom Slicer the button for Brazil has moved to the bottom of the list (the
list items were previously in alphabetical order) and its appearance has changed, looking greyed-
out. This is a visual indication that the source data contains no shipments of Soybeans from Brazil
in 2006.

Try this: Although greyed out the Brazil button has not been disabled. To confirm this click
the Brazil button on the CountryFrom Slicer. The 2006 and Soybeans buttons remain
selected but their appearance has now changed, and all the data has disappeared from the
PivotTable, confirming that there is no data for 2006, Soybeans and Brazil. Return the
PivotTable to its previous appearance by clicking the Clear Filter button on the
CountryFrom Slicer.

You can dictate the way that a Slicer behaves by changing its options.

Step 63: Click the Title Bar of the CountryFrom Slicer to select it then go to the Slicer
Tools, Options and click the Slicer Settings button. In the Slicer Settings dialog box
remove the tick from the checkbox labelled Visually indicate items with no data. Leave
the dialog box open.

Step 64: In the Caption textbox of the Slicer Settings dialog box change the entry from
CountryFrom to Exporter. Click the OK button to close the dialog box and apply the
changes (Fig. 16).

©Martin Green www.fontstuff.com 8


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 16 The Slicer Settings dialog box.

The Brazil button has disappeared from the CountryFrom Slicer which now displays the title
Exporter. Notice also that the neat horizontal arrangement of the Slicers has also changed and
there is now a wider gap between the Exporter and Commodity Slicers (Fig. 17).

Fig. 17 The position and appearance of the Slicers have changed.

The horizontal alignment of the slicers has changed because the default behaviour of an object on
a worksheet is to move with the underlying cells. As the dimensions of the PivotTable change when
the data changes, the Slicers may also change position.

Try this: Select 2007 on the Year Slicer and Argentina on the Exporter Slicer. Notice
that the Commodity Slicer has now moved some distance to the left and now sits partially
behind the Exporter Slicer.

To prevent this behaviour another setting must be changed.

Step 65: Remove the filters applied by the three Slicers by clicking the Clear Filter button
on each one.

The PivotTable has now returned to the condition it was in when the slicers were first positioned on
the worksheet.

Step 66: Select all three Slicers by clicking on the Title Bar of the first one and holding down
[Ctrl] whilst clicking on each of the others. On the Ribbon go to Slicer Tools, Options
and click Group then Group.

Fig. 18 Group the selected Slicers.

©Martin Green www.fontstuff.com 9


Microsoft Excel 2010 Step-by-Step Pivot Tables

A box appears around the three Slicers indicating that they are now grouped and as such can be
treated as a single object on the worksheet. Their positions in relation to each other will not
change, but each member of the group can still be selected individually if changes are to be made
to their properties or other options.

Step 67: Choose 2007, Argentina and Soybeans from the appropriate Slicers and notice
that their positions relative to each other no longer change (Fig. 19).

Fig. 19 Grouping Slicers maintains their spacing on the worksheet.

As mentioned earlier, Slicers can be treated like other worksheet objects and individually moved or
sized in the usual way by dragging the handles that appear around the edge of each when they are
selected. The same applies to a group of slicers. For example…

Step 68: Make sure no Slicers are selected by clicking on an empty cell on the worksheet
then click on the Title Bar of one of the Slicers. This selects the whole group. Point at the
sizing handle midway down the right hand edge of the group box so that a horizontal two-
headed arrow appears, then drag to the left to resize the slicers, leaving them wide enough
to display all their text items (Fig. 20).

Fig. 20 The Slicers can be resized as a group.

Note: You might notice that although grouping prevents the horizontal spacing of a group
of Slicers from changing, their relative widths might change. If this becomes a problem
right-click on a Slicer, a selection of Slicers, or the group (whichever is appropriate) and
choose Size and Properties from the menu. In the Properties section of the dialog box
choose Don’t move or size with cells.

If space is limited, the height of the Slicers can also be changed. Note that, although all the items
are on display, there is empty space in both the Exporter and Commodity Slicers.

Step 69: Use the sizing handle midway along the lower edge of the Slicer group box to
reduce the height of the slicers, so that all the Commodity items remain visible (Fig. 21).

This also illustrates what happens if there is not enough room on the Slicer to display all the items
in that Slicer’s field. The Year slicer now has a scrollbar to allow the user access to all the available
Year items.

©Martin Green www.fontstuff.com 10


Microsoft Excel 2010 Step-by-Step Pivot Tables

Fig. 21 The height of the Slicer group has been reduced.

If you would prefer not to see a scrollbar on a slicer, and space permits, you can use the option to
show the items in multiple columns.

Step 70: Select just the Year Slicer (this might require one or two clicks depending on its
current selection status) then on the Ribbon go to Slicer Tools, Options and change the
Columns setting to 2.

The items on the Year Slicer are now shown in two columns so that all the available choices are on
display without the user having to scroll (Fig. 22).

Fig. 22 The Year Slicer now shows two columns of buttons.

Most of the remaining Slicer options are self-explanatory and deal with the appearance or
positioning of Slicers on the worksheet. An important exception is the PivotTable Connections tool.
This tool allows the user to use a single Slicer to filter more than one PivotTable. When a Slicer is
selected and the PivotTable Connections button clicked Excel displays a dialog box listing the
available PivotTables for the selected Slicer (Fig. 23). Simply place a tick against the PivotTables
you want the Slicer to filter and click OK.

Fig. 23 Use PivotTable Connections to filter multiple PivotTables.

Conclusion
This concludes Exercise 4. In this exercise you have learned how to use Filters to control which
data is included in the PivotTable, and discovered how to employ Slicers to perform the same task
in a more efficient and user-friendly way. The next exercise will continue from this point so if you
wish to proceed to the next exercise you should save the file in its current state.

©Martin Green www.fontstuff.com 11

Das könnte Ihnen auch gefallen