The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by IKBN Peretak, 2021-07-28 00:05:57

Microsoft Excel Advanced

Microsoft Excel Advanced

Microsoft Office Excel 2010 Advanced 146

There are also sort options available on the PivotTable Tools – Options tab:

To sort data based on a specific row label in ascending order, click on data in that row label, and
then click the sort ascending (A to Z) button. For example, if we click on the name of a salesman
in the table, and then click on the sort ascending button (smallest to largest):

The table will then look like this:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 147

There is one more sort tool available in the Sort and Filter group of the Options tab:

Choosing this button will display another dialog with more options for sorting:

This dialog lets you specify a smallest to largest sort, or largest to smallest. It also lets you
specify direction the data will be sorted in (top to bottom or left to right).

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 148

Note that the dialog is called Sort by Value. This is because a numerical value was selected in
the PivotTable before invoking the dialog. If we first select a row label like salesman or product,
the dialog will look a bit different:

Grouping Data
When you are working with PivotTables, there are also grouping tools available on the Options
tab:

These tools are very similar to the grouping tools discussed in Lesson 1.1. To use them, first
select a range of data that you want to group or ungroup, and then click the appropriate
button.
For example, here is a PivotTable that is somewhat awkward due to its length.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 149

To make the table more manageable, select the range of cells that contain the region labels and
then click Options → Group Selection:

As a result, the data will be grouped by region in the PivotTable and there will be a “Group 1”
option with a corresponding (-) collapse button available above the row of region labels.

To collapse the group, just click the collapse button and the PivotTable will look like this:

The region labels are now hidden, and the sales and profit data have been subtotaled and
summarized. Now the important data can be seen at a glance.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 150

If you want to see all of the detail of the table again, just click the expand button (+).

If you want to remove the grouping, click on the Group1 label to select it and then choose
Options → Ungroup:

The grouping will be removed and the PivotTable will appear as it did originally.

Refreshing Data

PivotTables are always based on some underlying source data. That data may be in another
workbook, another worksheet, or perhaps a totally different location like an external database.
The point is that the data that your PivotTable is based on can be easily changed by anyone
who has access to the spreadsheet. By using the Refresh command, you can make sure your
PivotTable changes accordingly when the source data has been altered.

Here is a sample table of source data.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 151

Here is a PivotTable based on this data:

Now suppose that we remove the information for Month 3 in the source table:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 152

At this point, the PivotTable will still display the Month 3 data exactly as it did before. To
update the table, click Options → Refresh:

After performing this action, the PivotTable will reflect the changes in the source data:

This technique also works if you change the values in the source data. Study the PivotTable
above for a moment, and then note the following changes to the source data.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 153

At first, the PivotTable will not reflect the changes, but after you click the Refresh button, the
PivotTable will update:

The resulting table changes look like this:

Another way to refresh is to right-click the PivotTable and click Refresh:

This will also refresh the PivotTable to accommodate changes to the data source.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 154

Editing the Data Source

It might also be the case that the actual underlying cell range of the source data has been
expanded:

In this kind of situation, you should update your PivotTable by choosing Options → Change Data
Source:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 155

Performing this action will display the source data, with a dashed line indicating the range of
cells that are currently included in the PivotTable. There will also be a dialog that will allow you
to select a new cell range:

Now, re-select the entire range of data with your mouse, and check to make sure that it is
correctly entered into the dialog:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 156

As soon as you have successfully selected the new range, click OK. The PivotTable will be
automatically updated to accommodate the new range and additional data:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 157

Lesson 2.3: Formatting a PivotTable

Up to this point the focus has been on practical PivotTable skills so that the table provides what
you need in an analytical sense. Now that you understand something of the function and
applicability of PivotTables, it is time to spend some time on presentation and modification so
you can turn your PivotTable into a professional-looking report.

In this lesson you will learn how modify your table’s fields, values, and labels. You will learn how
to apply layouts and styles to a PivotTable. You will also learn how to manually format a
PivotTable, and use the PivotTable Options dialog.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 158

Modifying Fields and Labels

There are a few ways to modify the layout of the labels and fields in your PivotTable. To start,
select a field in your PivotTable (the Month field in this example):

Next, click Options → Field Settings:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 159

Then you will see the Field Settings dialog:

Under the Subtotals and Filters tab, you will find options for Automatic Subtotals (the default
setting), None (no subtotals), and Custom (where you can choose how the subtotal will be
calculated). Custom options include Sum (the default), Count, Average, Max and Min, and
several others.
It is important to understand that these subtotal functions are intended for use with fields
representing numerical data values, like a profit or sales field. Since we are using the “Month”
field in this example, which is descriptive rather than numerical, these subtotals are not really
applicable.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 160

Instead, the options on the Layout and Print tab are best suited for the Month field:

These options allow you to change the layout of a field and its accompanying labels. To start,
let’s look at the two radio buttons on this tab.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 161

First, here is a sample PivotTable. Notice how the row labels (from the “Month” and “Product”
fields) are arranged in one column.

If the “Display labels from the next field in the same column” checkbox is cleared, the layout of
the labels in the table will look like this:

Notice how Month and Product are now separated.
Suppose now that the second radio button had been selected instead.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 162

The options for the first radio button are no longer accessible, and the change in layout of the
table is almost the same as before, with the small difference that the second field’s labels (the
product types) line up in the same row as the first field’s labels:

If you put a checkmark in the “Repeat item labels” box:

The label for the selected field (Months) will be repeated for every row with corresponding
data:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 163

If you specify “Insert blank line after each item label:”

A blank line will be included after the total tow for each different label:

If you place a checkmark next to “Show items with no data:”

The labels will be displayed in the table even if there is no source data for them, as long as the
PivotTable’s range includes the empty data rows.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 164

For example, here is the source data for a table:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 165

You should notice that the range that the PivotTable is based on contains empty rows. Even so,
the labels for the empty rows are included in the PivotTable.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 166

Modifying Values

We just talked about modifying the layout of descriptive fields and their associated labels. For
value fields with numeric data, the process is almost the same. First, select a value in your
PivotTable:

Then, click Options → Field Settings:
This time, the Value Field Settings dialog box will look slightly different:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 167

On the first tab, you will see options for creating totals and subtotals for the selected field. The
default function is Sum, but you can click a function type in the list to select it and apply the
new calculations to the values associated with the selected field. For example, if we click
“Average” and then click OK:

The PivotTable data will now reflect averages for the Profit values instead of summed totals:

The Show Values As tab in the Field Settings dialog will give you another set of options for
modifying the numerical data in your PivotTable:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 168

To see these options, click the pull-down arrow on the right to see the drop list:

In the image above, “% of Grand Total” has been selected. This means that the values for Profit
will be expressed as percentages of the total profit. Clicking OK will implement the changes in
the PivotTable.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 169

This is just one of several ways you can choose to display the numerical data for the Profit field.
For another, let’s assume that you want to show the profit values as a percentage of the total
profits for the East region. To do this, you would choose the “% Of” option from the “Show
values as” menu:

Next, choose the Base Field (Region in this case) and the Base Item (the East label) from the lists
provided in the dialog:

After these selections are made, clicking OK will implement them in the table. In this case, the
profit values will be represented as percentages of the profit for the eastern region.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 170

As a final note, whenever the Field Settings dialog box is displayed for a numerical type of field,
you will see a Number Format button at the bottom:

If you click this button, a Format Cells dialog will appear with a list of number format options
that that can be applied to the numerical data in the PivotTable. When you select an option in
the list, additional controls will appear in the dialog to help configure the details of the chosen
format. These additional options will vary according to the type of number format you select.

In the following example, the Accounting format is selected, so options appear for setting the
number of decimal places and the appropriate monetary symbol.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 171

After you set up the format, click OK in the Format Cells dialog and then in the Field Settings
dialog. The new format will be applied to the values in your PivotTable:

Finally, you can easily change what a PivotTable label says by selecting the cell that contains the
label and then editing the label in the formula bar. This simple method applies to both row and
column labels:

Using the Layout Group on the Design Tab
The Layout group of options on the PivotTable Tools – Design tab provides a quick and easy way
to change the layout of your labels and values in much the same way as using the Field Settings
dialog.
The Layout Group is found on the far left of the Design tab:

Each button in the Layout Group will open a menu of options when clicked. These options can
change the layout of your labels and values much like the options in the Field Settings dialog.
The Field Settings dialog provides more options, and may allow for a bit more fine tuning (such
as different number formats for numeric data, but the options in the Layout group are easier to
access and can be quickly implemented.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 172

For example, have a look at the following PivotTable:

There are grand totals for both rows and columns and subtotals at the top of each “Month”
group. The month labels and the product type labels are both in the same column, and there
are no blank rows in the table. All of the layout elements just listed can be modified with the
Layout group.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 173

If you click the Subtotals command, you will see a menu containing three options:

If you click the “Do Not Show Subtotals” option, all totals except the grand totals will be
removed from the PivotTable:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 174

If you choose the “Show all Subtotals at Bottom of Group” option, the PivotTable will display
subtotals at the bottom of each grouping.

Similarly, if you click “Show all Subtotals at Top of Group,” the table will display the subtotals at
the top of each grouping.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 175

The next button is the Grand Totals button. If you click this button, a menu of options for
displaying Grand Totals will appear.

The options here are fairly self-explanatory. You can choose:
 Off for Rows and Columns: Display no grand totals
 On for Rows and Columns: Display grand totals for both rows and columns
 On for Rows Only: Display grand totals for rows but not for columns
 On for Columns Only: Display grand totals for columns but not for rows

The next button in the Layout group is the Report Layout button:

The options available here are once again very similar to the options available from the Field
Settings dialog.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 176

The Show in Compact Form option will show all of the column labels in a single column, while
the Show in Outline Form option will show the labels for the second field in the column
immediately to the right of the labels for the first field.

The Show in Tabular Form option will arrange the PivotTable layout to look almost the same as
Outline Form, except the labels for the second field will start on the same row as the label for
the first field.

The Repeat All Item Labels option will display every instance of a label (much like what appears
in the source data). The Do Not Repeat Item Labels option will remove these redundant labels.

The final layout menu is Blank Rows:

This button provides two options: to insert blank rows after every field grouping or to remove
the same blank rows.

Applying a Style to a PivotTable

Excel provides a variety of preset styles to choose from to make formatting your PivotTable
easy. Each style includes a combination of borders, shading, font, and color formatting.

The PivotTable Styles are available on the PivotTable Tools – Design tab:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 177

On the Design tab, you will see thumbnails of the styles in the PivotTable Styles group. You can
see what your table might look like with a given style applied to it by letting your mouse pointer
hover over any thumbnail:

When you find a style that you like, just click on the thumbnail to apply it to your PivotTable.
If you right-click on a thumbnail, you will see this menu:

Of primary concern to us at this point are the first two options. If you click Apply and Clear
Formatting the style will be applied to the PivotTable, but previously applied formatting (like
fonts for labels or data values) will be cleared. If you click Apply and Maintain Formatting, the
formatting of some previous elements (like bold or italic fonts on data values and labels) will
remain when the style is applied.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 178

To see a wider range of styles to choose from, you can use the arrow buttons at the right side of
the style preview menu:

The up and down arrows will scroll groups of style thumbnails into view. The More button ( )
will show you the full gallery:

As before, you can let your mouse pointer hover over a thumbnail and a preview of the
selected style will be applied to your table. Click any thumbnail to make the application
permanent.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 179

Changing PivotTable Style Options
Let’s look at the PivotTable Style Options group next:

This group is made up of four checkboxes:
 Row Headers
 Column Headers
 Banded Rows
 Banded Columns

Checking an option will change the formatting of that component to make it stand out from the
rest of the table. Banded Rows/Banded Columns will apply borders and/or shading (depending
on the current table’s style) to every second row in your PivotTable; a helpful feature if you
have a lot of data.

The actual application of these formatting options can differ between styles, but here is an
example of banded rows:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 180

Manually Formatting a PivotTable

If you cannot find a preset style that you like, you can always manually format your PivotTable.
One way to do this is to select individual cells or ranges of cells and apply fonts, font color,
borders, and fill color with the formatting options on the Home tab:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 181

You can also select individual cells or ranges of cells and apply a preset cell style by choosing
Home → Cell Styles, and then clicking the cell style of your choice:

Similarly, you can select a cell or a range of cells in your PivotTable, and choose Home →
Format to see basic formatting options:

Here you can hide or unhide selected rows or columns, change the width or height of selected
columns or rows, or lock a selected range of cells.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 182

Using the PivotTable Options Dialog
To open the PivotTable Options dialog, click Options – Options:

This dialog provides multiple tabs, each containing options related to the tab’s heading. First,
the Layout and Format tab provides options for changing the presentation of your table
elements and the format of its values and cells:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 183

The Totals and Filters tab provides tools for displaying grand totals and for enabling and
modifying filtering and sort options:

The Display tab provides options to display or hide certain table elements and to make changes
to the layout of the table:

The Printing tab provides options for changing the print layout of the table:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 184

The Data tab provides options for specifying how certain aspects of PivotTable data are
handled:

For example, you could mark the appropriate check box to make sure that the source data is
saved with the file (which could be useful for an external data source), or that the data in the
table be refreshed each time the workbook is opened.

As with most other dialogs, once you have made your option choices, you can click OK in the
lower right to commit to them, or you can click Cancel to close the dialog without implementing
your choices.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 185

Lesson 2.4: Using the Classic PivotTable Layout

At this point we have covered quite a lot of ground on the subject of Excel PivotTables. Creating
a table, formatting it, and pivoting the data should pose little difficulty now, but there is always
something new to learn! In this lesson, we’ll learn about the older-style Pivot Table, called the
classic layout.

Creating an Empty (Classic) PivotTable Frame
Some Excel users like to work with a classic PivotTable layout (also called a classic PivotTable
frame) because the classic layout allows you to build a PivotTable intuitively, by dragging and
dropping fields right onto the table area. Of course, even with a classic layout, you can always
use the usual methods for adding data to the table if you want to.
A classic PivotTable frame begins with the creation of a standard PivotTable. (See Lesson 2.1 if
you need a refresher.)

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 186

Once you have a standard PivotTable, the next step is to display the PivotTable Options dialog.
You can do this by right-clicking in the standard PivotTable area and choosing PivotTable
Options:

Alternatively, you can click in the PivotTable area and then choose PivotTable Tools – Options
→ Options:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 187

When the PivotTable Options dialog appears, click the Display tab. Place a checkmark next to
the “Classic PivotTable layout” option and then click OK.

At this point you should see a classic PivotTable frame in your worksheet:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 188

Switching an Existing PivotTable to a Classic Layout

If you have already created a PivotTable it is easy to convert it to a classic layout, even if it
contains data.

Simply follow the steps we just discussed. First, display the PivotTable Options dialog by either
right-clicking in the table and clicking PivotTable Options, or by clicking PivotTable Tools –
Options → Options.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 189

When the PivotTable Options dialog appears, click the Display tab and then click to select the
checkbox for the “Classic PivotTable layout” option:

Now, click OK in the dialog to apply the classic layout:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 190

Adding Data

With a classic layout, it is easy to add data to the PivotTable. If you wish, you can add data in
the same way that you would with a standard PivotTable: place checkmarks in the Field List to
select the fields that you want to add to the PivotTable.

For more control on how the table is arranged, you can drop and drag fields from the top part
of the Field List to the Report Filter, Column, Row, and Value Area boxes at the bottom of the
Field List:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 191

Here is what the resulting PivotTable would look like:

Or, you can simply drag fields directly from the Field List and drop them in the PivotTable
frame:

Just make sure that you drag and drop the fields into the areas in the table frame labeled,
“Drop (field type) Fields Here:”

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 192

You can just as easily remove the data from a classic layout table by dragging and dropping the
field name from the PivotTable back to the Field List, or to basically any place outside of the
PivotTable borders:

You can also remove data by deselecting fields in the Field List, or by dragging the fields out of
the area boxes at the bottom of the Field List (just as you would with a standard PivotTable).

Pivoting Data

If you recall, pivoting data is the technique of rearranging the structure of your PivotTable to
explore various relationships between your data fields. In a classic PivotTable layout, you can
pivot data by dragging and dropping fields directly to and from the table area.

To make the best use of your classic layout PivotTable, you should understand what the various
areas in a PivotTable are for. You can see by examining an empty classic PivotTable frame that
the table is broken into four main areas:

 Report Filter Fields
 Column Fields
 Row Fields
 Value Fields

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 193

These regions of the PivotTable correspond to the table area boxes at the bottom of the
PivotTable Field List:

The Report Filter area allows you to filter based on the labels that are associated with the field
you drop here. It is ideally suited to fields that are used to identify periodic or organizational
groupings of the data in your other columns.

For example, if we put the Salesmen field in this region, we will be able to filter all the table
data based on the labels (salesmen’s names in this case) associated with that field:

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 194

The Row Field and Column Field areas of the table are used to further categorize the data that
you want to examine. When you place fields in the row and column field areas of the table, you
will see how these fields relate to each other in the context of the data in the Value Fields area.

For example, in the following table, we have dragged the Region field to the Row Field area of
the table and the Product Field to the Column Field area of the table:

Now, when we drag a field to the Value Field area of the table, we will see the values for that
field subtotaled and listed for each region, and across every product type.

The Value Field area provides the underlying context for the rest of the PivotTable. The field(s)
that you choose for the Value Field area of the table normally have numeric values associated
with them, like units sold, profit, or expenses. This is the data that will be measured and totaled
to reveal trends or indicate possible relationships between the non-numeric data.

To continue with the previous example, suppose we drag the Sales field to the Value Fields
area:

Now we see the units sold for each region, broken down across product types.

© 2005-2011 Velsoft Training Materials, Inc.

Microsoft Office Excel 2010 Advanced 195

To remove fields (and the associated data) from the table, clear the corresponding check boxes
in the Field List. Clearing all of the checkboxes will leave an empty classic PivotTable frame.

© 2005-2011 Velsoft Training Materials, Inc.


Click to View FlipBook Version