Sunteți pe pagina 1din 54

EXCEL PIVOT TABLES

Nabil W. Mourad
All Rights Reserved

Website: www.OfficeInstructor.ca

Follow Us: Facebook.com/OfficeInstructor


Excel Pivot Tables From Zero To Hero

TABLES ................................................................................................................................................... 3
BENEFITS OF USING TABLES: .................................................................................................................................. 3
TABLE SIZING HANDLE ......................................................................................................................................... 5
TABLE TOOLS ..................................................................................................................................................... 5
CREATE A PIVOTTABLE ........................................................................................................................... 6
MANUAL PIVOTTABLE ............................................................................................................................ 6
ADD FIELDS TO A PIVOTTABLE ............................................................................................................................... 9
PIVOTTABLE AREAS.............................................................................................................................................. 9
NESTED FIELDS WITHIN COLUMNS ........................................................................................................................ 10
NESTED FIELDS WITHIN ROWS .............................................................................................................................. 11
REMOVE FIELDS FROM A PIVOTTABLE ................................................................................................................... 12
RECOMMENDED PIVOTTABLES ............................................................................................................. 12
CHANGING THE DATA SOURCE ............................................................................................................. 14
DELETE A PIVOTTABLE FROM A WORKSHEET ....................................................................................... 15
PIVOTTABLE OPTIONS .......................................................................................................................... 15
A FEW SETTINGS TO CHECK OUT ARE: .................................................................................................................... 16
REPORT LAYOUT ................................................................................................................................................17
SUBTOTALS AND GRAND TOTALS ......................................................................................................................... 19
BLANK CELLS .................................................................................................................................................... 20
REFRESH DATA IN A PIVOTTABLE ......................................................................................................................... 21
FORMAT PIVOTTABLE DATA ................................................................................................................. 22
CHANGE THE VALUE SETTINGS ............................................................................................................. 24
SHOW TOTALS AS A PERCENTAGE ........................................................................................................ 27
RENAME COLUMN FIELD NAMES .......................................................................................................................... 29
SORT A PIVOTTABLE ............................................................................................................................. 30
APPLYING A CUSTOM SORT ................................................................................................................................. 32
EXPAND/COLLAPSE DATA ..................................................................................................................... 35
DRILL DOWN ......................................................................................................................................... 36
MOVING A PIVOT TABLE........................................................................................................................ 37
GROUPING DATA BY DATE/TIME ........................................................................................................... 38
PIVOTTABLE TIMELINE .......................................................................................................................... 40
CREATING A CALCULATED FIELD ........................................................................................................... 42
EDIT A CALCULATED FIELD .................................................................................................................................. 44
PRINTING PIVOTTABLES ....................................................................................................................... 45
PRINT TITLES IN A REPORT .................................................................................................................................. 46
INSERT A PIVOTTABLE CHART............................................................................................................... 48
EDIT A PIVOTCHART ........................................................................................................................................... 48
CHART ELEMENT ............................................................................................................................................... 48
CHART STYLE .................................................................................................................................................... 49
CHANGE CHART TYPE ......................................................................................................................................... 49

www.OfficeInstructor.ca Page 1 of 53
Excel Pivot Tables From Zero To Hero

SLICER TOOL ......................................................................................................................................... 50


INSERT SLICER ................................................................................................................................................... 50
DELETE A SLICER ............................................................................................................................................... 52

www.OfficeInstructor.ca Page 2 of 53
Excel Pivot Tables From Zero To Hero

Excel Tables and Pivot Tables


A PivotTable is a powerful tool used to summarize and reorganize data
from an Excel spreadsheet. PivotTables are very useful whenever we have
a lot of data to analyze.

PivotTables are dynamic and interactive, meaning the data can be


reorganized and redisplayed easily based on what the end result we want.
Even though PivotTables are dynamic, it is best to plan out the end result
for the data, before creating a PivotTable.

Although we can use a list as a source data, it is best practice to format


the data as a table before creating a PivotTable because if further data is
ever added to or deleted from the original data, a table will automatically
adjust to allow for the newly added, or deleted data to be displayed in the
PivotTable, as long as the PivotTable data is refreshed.

Tables

Tables are very beneficial when working with large amounts of data,
especially if that data may potentially change. Tables give a nice visual
layout of the data, it adds functionality to your list, so it is easier to sort
and/or filter the data.

Benefits of using tables:

• Integrated Filter and Sort functionality


• Header row remains visible while scrolling, as long as the cursor is
within the Table
• Automatic expansion and subtraction of the table when new data is
entered (Table Auto-Expansion)
• Automatic adjustment charts when new data is entered
• Automatic reformatting of the table by applying styles
• Create a formula once and have it automatically copied to the entire
column (Formula Replication)
• Uses a structured reference instead of regular cell references.
• Enables you to add a fully functional “Total” row.

www.OfficeInstructor.ca Page 3 of 53
Excel Pivot Tables From Zero To Hero

To convert a block of data into a Table, place the cursor within the data.
Navigate to the Insert Tab then click on the “Table” icon. Excel will highlight
the entire list and display the “Create Table” dialog box.

You can also convert a list into a table by going to the Home Tab of the
ribbon and select “Format as Table”. Excel will populate the “Format As
Table” dialog box. In either case, you will confirm the location of the data to
be converted into a table, as well as an option to specify if the data contains
headers. When the data location and the header option is selected, click OK.

The look of the data on the sheet will change slightly, with the addition of
a more distinct header row, alternating colored rows, as well as with

www.OfficeInstructor.ca Page 4 of 53
Excel Pivot Tables From Zero To Hero

filtering/sorting options applied to each heading. The “Design” Tab is also


added to the ribbon.

If any columns of the original data have formatting applied, that formatting
will carry over to the data within the table.
You can also convert a list to a table by using the shortcut CTRL + L or
CTRL +T, or by using the Quick Analysis tool (which pops up
automatically when selecting the list). The click on “Tables”.

Table Sizing Handle


On the lower right corner of the table, there is a dark icon,
called the Sizing Handle.
The sizing handle indicates the bottom, right side of a
table.
Table Tools
Any time the cursor is within the table data, the “Table Tools Design”
Tab will be displayed on the right side of the ribbon. To make any changes
to a table, the cursor must be located within the table data.

www.OfficeInstructor.ca Page 5 of 53
Excel Pivot Tables From Zero To Hero

To change the color scheme of a Table, make sure the cursor is within the
table and then navigate to the “Table Tools Design” Tab. On the right hand
side of the Design Tab is the “Table Styles” group. To select a new color,
simply click on the color option to apply it to the table.

To view more options than


what are displayed, click on
the dropdown menu on the
lower right corner of the
Table Styles group.

Create a PivotTable
When creating a PivotTable, it is best practice to ensure the data does not
contain subtotals or blank cells. Blank data may cause issues within the
PivotTable by creating column names or cells to display as (blank).
Tip: It is best practice to convert the data into a table before creating the
PivotTable.

Manual PivotTable
To create a manual PivotTable, make sure the
cursor is within the table (data) on the
worksheet. Navigate to the Insert Tab and then
click on the PivotTable icon.

www.OfficeInstructor.ca Page 6 of 53
Excel Pivot Tables From Zero To Hero

Note: Users may also select one cell in the source data on the worksheet
and use the shortcut is ALT + N + V

On the Create PivotTable window, make sure the correct table, or data
range, is selected in the Select a Table/Range textbox. It should be correct
if you have blank cells around your source list. If the range is incorrect, move
the cursor into the Select a table or range textbox and then highlight the
correct data from the sheet.
On the bottom of the Create PivotTable window, choose the location to
place the PivotTable, either a new worksheet, which will be
automatically created to the left of the current sheet, or an Existing
Worksheet.
If the
Existing
Worksheet
option is
selected,
click within
the Location textbox and then navigation to the sheet and cell location to
insert the PivotTable.

When all of the options have been selected, click on the OK button to
create the PivotTable

www.OfficeInstructor.ca Page 7 of 53
Excel Pivot Tables From Zero To Hero

The PivotTable will be inserted onto a sheet and will look similar to the
screenshot below.

Pivot Table
Placeholder

Pivot Table
Fields

Pivot Table
Drop Areas

The PivotTable consists of a blank PivotTable placeholder on the left side


of the screen, the PivotTable Fields (column headings from the original
data), on the top right side of the screen, and the PivotTable areas on the
bottom right side of the screen. Two contextual Tabs are also added to the
ribbon: “Analyze” & “Design”.

www.OfficeInstructor.ca Page 8 of 53
Excel Pivot Tables From Zero To Hero

Note: To make changes to a PivotTable, the PivotTable Tools tab must be


active. If the PivotTable Tools Tab is not active, move the cursor within the
PivotTable.

Add Fields to a PivotTable


To make a PivotTable, fields must be added to the PivotTable areas.
To automatically add a field to a PivotTable, click on the checkbox next to
the Field name and Excel will place the field in the area that it sees is the
best fit for that field.
Note: This can be a good way to start working with PivotTables, but
typically a manual process is a better option for adding fields to a
PivotTable
To manually add a field, click and hold on a field name and then drag the
name into one of the four PivotTable areas listed below the field list.
If the PivotTable isn't displaying the information as intended, users are able
to drag fields into any of the other field areas on the fly by clicking and
holding on a Field, and then dragging the field name into a new area.
Tip: Not every field has to be used when creating a PivotTable, there may
be times when only 2 or three fields are used, and there may be times when
all fields are used. This is a major benefit of PivotTables, they are dynamic
so there is no right answer, it all depends on what information is to be
displayed.

PivotTable areas
1. Filters — Top-level filters that are displayed above the PivotTable
a. Filters can be used to only display results that meet certain
criteria
i. For example, only display results for a single region vs all

regions

www.OfficeInstructor.ca Page 9 of 53
Excel Pivot Tables From Zero To Hero

2. Columns — Display as column labels across the top of the


PivotTable, with the data displayed below. Field names on the top of
the columns area will display on the top within the PivotTable.
Columns may have several fields added to them to nest the column
labels.
3. Rows — Display as row labels on the left side of the PivotTable.
Rows may also have several fields to nest the row labels.

4. Values — Displays as a calculation of the data in the field. The


calculation can be a sum, count, average, etc.

Nested fields within Columns


You can drag more than one field to the columns area like this figure

www.OfficeInstructor.ca Page 10 of 53
Excel Pivot Tables From Zero To Hero

Nested fields within Rows


You can drag more than one field to the Rows area like this figure

www.OfficeInstructor.ca Page 11 of 53
Excel Pivot Tables From Zero To Hero

Remove Fields from a PivotTable


To remove a field from a PivotTable, uncheck
the field name from the Choose fields to add
to report area section of the PivotTable Fields,
or click, hold and drag the field name from the SalesRep
areas section back into the Fields section. You
will notice a delete symbol hanging to your
mouse pointer.

Tip: There is nothing wrong and nothing right


when dragging fields to the different drop
areas. It all depends on HOW you would like
to envision your data, and from which
perspective you want to look at your data.

Recommended PivotTables
Recommended PivotTables is a feature introduced to Excel 2013 which
provides a
few PivotTable options based on the data in a
worksheet.
To use the Recommended PivotTables feature, make
sure the cursor is within the data. Navigate to the
Insert Tab, and then select the Recommended
PivotTables icon.
A new Recommended PivotTable window will appear showing the options
that Excel is recommending for the PivotTable.

www.OfficeInstructor.ca Page 12 of 53
Excel Pivot Tables From Zero To Hero

Users are able to click on


each option to see a
preview of how the
PivotTable will display.
Recommended
PivotTables can be a useful
option to use for a starting
point for a
PivotTable, but it may not
be the best option based
on what is expected as an
end result.
If none of the options are
going to work, click on the
Blank PivotTable button to
create a Blank
PivotTable button on the
lower left side of the Recommended PivotTables window to create a blank
PivotTable.

Tip: To view PivotTable Recommendations on an existing PivotTable, make


sure the
cursor is
within the
PivotTable.
Navigate to the PivotTable Tools Analyze Tab and then click on the
Recommended PivotTables icon.
Note: To make changes to a PivotTable, the PivotTable Tools Tab must be
active. If the PivotTable Tools tab is not active, move the cursor within the
PivotTable.

www.OfficeInstructor.ca Page 13 of 53
Excel Pivot Tables From Zero To Hero

Changing the Data Source


If data is added to the
PivotTable source data,
and if the PivotTable
was created without
using a table, a new
data source may have
to be selected to
ensure the PivotTable
contains the newly
added data.
To change the original data source, make sure the cursor is within the
PivotTable, navigate to the
PivotTable Tools Analyze
Tab and then click on the
Change Data Source
button. Select the new
data range which may be
on a different worksheet,
or workbook and then click
on the OK button.

Tip: The Change Data Source option may also be used to verify where the
original data is located.
Note: If the new data is coming from an external data source, a new
PivotTable will have to be created and the option for External Data Source
will have to be selected in the Create PivotTable dialog box.

www.OfficeInstructor.ca Page 14 of 53
Excel Pivot Tables From Zero To Hero

Delete a PivotTable from a Worksheet


To delete, or clear all of
the data from, a
PivotTable make sure
the cursor is in a cell in
the PivotTable.
Navigate to the
PivotTable Tools
Analyze Tab, in the
Actions group, click on
the Clear button, and
select the Clear All option.
Another way to clear data from a PivotTable would be to deselect all of the
fields in the PivotTable task pane. Note, you are not deleting the pivot
table placeholder.
To delete the Pivot Table and the place holder, select it, then on the Home
Tab, in the Editing group click the down arrow for “Clear” and select “Clear
All”. You can also use the shortcut ALT + E + A +A

PivotTable Options
The settings for how a PivotTable will display by default are located
PivotTable options menu. To get to the PivotTable options, make sure the
cursor is in the PivotTable data, navigate to the PivotTable Tools Analyze
Tab. On the far the left side of the window, select Options, which is
located under the PivotTable name textbox.
Right
Click
menu

Tip: Another way to access the PivotTable options is to right click within a
PivotTable and then select PivotTable options.

www.OfficeInstructor.ca Page 15 of 53
Excel Pivot Tables From Zero To Hero

A few settings to check out are:

• Sorting — Located on the


Display Tab. The default
setting for how the data is
sorted is based on how the
data is displayed in the original
data source. To sort all data
alphabetically, select the Sort A
to Z option on the bottom of
the tab.
• Refresh Data — By default,
the data within a PivotTable
will not update unless a user
manually refreshes the data.

On the Data Tab, there is an option that will automatically refresh the
PivotTable data
anytime the file is
opened. This may
be a good option
to check just in
case the original
data has changed
while the
PivotTable was
closed.

www.OfficeInstructor.ca Page 16 of 53
Excel Pivot Tables From Zero To Hero

• Grand Totals —
Grand totals will
display on every
PivotTable
created by
default. To not
display Grand
Totals by default,
uncheck the
Grand Totals
option from the
Totals & Filters
tab.

Report Layout
By default, a PivotTable is shown in the
Compact Form layout. Compact Form
layout does not display descriptive names
for column or row labels, nor does it
indicate that the top line on a row displays
the total for that row.
To change the labels to allow for a more
descriptive label on columns and rows,
make sure the cursor is within the
PivotTable, and then navigate to the
PivotTable Tools Design Tab. On the left
side of the Ribbon in the Layout group,
click on the Report Layout dropdown.
The two other options available are Outline Form and Tabular Form.
Either of these options will provide a more descriptive name for both row
and column labels, but the major difference is that, Tabular form will place
more emphasis to Subtotals, which will be located on the bottom of the
group, whereas Outline Form will display the subtotals on the top of the
group.

www.OfficeInstructor.ca Page 17 of 53
Excel Pivot Tables From Zero To Hero

Compact Form

Outline Form

Subtotals
at the Top

www.OfficeInstructor.ca Page 18 of 53
Excel Pivot Tables From Zero To Hero

Tabular Form

Subtotals
at the
bottom

Subtotals and Grand Totals


The Subtotal and Grand Total will display the subtotal for each field and
the overall Grand total by default in a PivotTable.

www.OfficeInstructor.ca Page 19 of 53
Excel Pivot Tables From Zero To Hero

To turn off the subtotal option for a group, or to change the location of the
subtotals, navigate to the PivotTable Design tab, click on the Subtotals
dropdown and select the appropriate option.

To turn off the Grand Total option for a group, or to change the location of
the grand totals, navigate to the PivotTable Design tab, click on the Grand
Totals dropdown and select the appropriate option.

Blank Cells
Blank cells may cause
problems within a PivotTable if
the data ends up being a row
or column heading.
Sometimes, blank data is
significant to the data
displayed in the PivotTable, so
blank cells are needed to
represent the data correctly.

By default, all blank cells


within a PivotTable will display
as blank, or as an empty cell.
Depending on the type of data
that is being displayed, it may
be best to change the blank
cells into a value. If the data is
displaying Sales, it may be
best to display the blank data as a zero to show that there weren't any sales
for a particular day, region, etc. To change the display or blank cells, right
click within the PivotTable and selecting PivotTable Options.

Tip: PivotTable options may be selected by navigating to the PivotTable


Tools Analyze Tab and then select PivotTable options on the left side of the
ribbon.

On the PivotTable Options window, navigate to the Layout & Format Tab.
On the bottom of the window in the Format section, make sure there is a

www.OfficeInstructor.ca Page 20 of 53
Excel Pivot Tables From Zero To Hero

checkmark next to the “For empty cells show:” option. In the textbox,
enter in the value to display in all blank cells.

Refresh Data in a PivotTable


The data within a PivotTable is not
automatically updated when the
original data has been changed.
Anytime any of the original data is
changed, a PivotTable must be
refreshed to display the newly updated
data.
To refresh the data in a PivotTable,
navigate to the PivotTable Analyze tab,
select the Refresh icon and then
choose Refresh All.
Note: Refresh will only update the data from the source connected to the
active cell. Refresh All will refresh all data within the current workbook.
Tip: The shortcut to Refresh All is Ctrl-Alt-F5.

www.OfficeInstructor.ca Page 21 of 53
Excel Pivot Tables From Zero To Hero

Refresh data may also be turned on to refresh any time a file is opened.
On the PivotTable Tools Analyze Tab, select Options, which will be
located under the PivotTable Name text box.
From the PivotTable Options dialog box, select the Data tab and then
check the option to Refresh data when opening the file.

Note: Depending on how wide the Excel window is, Options may not
display immediately. If Options isn't visible, click on the PivotTable icon on
the left side of the screen and then select Options.

Right
Format PivotTable Data Click
PivotTables do not carry over menu
the formatting applied to the
source data. All formatting in a
Pivot Table must be applied to
the data in the PivotTable.
To set the formatting for an
entire field in a PivotTable, right
click on any cell within the
column, and then select
Number Format. From the
Format Cells dialog box, select
the appropriate data type and
click the OK button.
Note: When a cell in a
PivotTable is right clicked on,
there is an option to Format
Cells. When selecting this
option, formatting will only be
applied to the selected cell, not
the entire column.
Tip: Although clicking on “Format Cell” or “Number Format” opens the
“Format Cell” dialog box, yet the dialog box is not the same in both cases.
When you click on “Format Cell”, you open the classic “Format Cell” dialog

www.OfficeInstructor.ca Page 22 of 53
Excel Pivot Tables From Zero To Hero

box with six Tabs. While if you click “Number Format” you open a variation
of the “Format Cell” dialog box, specially designed for Pivot Tables with one
Single Tab.

The Field Settings drop down menu may also be accessed from the
PivotTable Analyze tab. It has a “Number Format” option in the lower left
corner, which when clicked, opens the same dialog box as above.

www.OfficeInstructor.ca Page 23 of 53
Excel Pivot Tables From Zero To Hero

1. Make sure the cursor is in a cell in the column to be formatted.


2. Select the PivotTable Tools Analyze Tab.
3. Click on Field Settings on the left side of the ribbon.
4. On the Value Field Settings Dialog box, select the Number Format
button in the lower left side of the dialog box.
5. On the Format Cells window, select the format for the cell(s)
6. Click OK to apply the changes to the cells.

Change the Value Settings


By default, Excel sets the Value of "Sum" to a field added in the Values area
of a PivotTable. This value may be changed to several different options
including; Average, Maximum, Minimum, and/or Count.
On the PivotTable Fields area, click on the drop-down menu on a field that
is currently in the Values section and then select the Value Field Settings
option.

www.OfficeInstructor.ca Page 24 of 53
Excel Pivot Tables From Zero To Hero

On the Value Settings dialog box, select the appropriate option; Average,
Max, Min and then click the OK button.

www.OfficeInstructor.ca Page 25 of 53
Excel Pivot Tables From Zero To Hero

Alternatively, you
can change the
summary function
by right clicking a
cell in the pivot Right
table, and from Click
the right click menu
menu select:
“Summarize
Values By”, then
from the
submenu select
the proper
function. If you
do not see the
function you want
in this list, e.g.
STDEV, clicking
on “More
Options” takes
you to the “Value

www.OfficeInstructor.ca Page 26 of 53
Excel Pivot Tables From Zero To Hero

Field Settings” dialog Box.

Tip: The function in use appears in the Upper Left corner of the pivot table.

Tip: When dragging a text field to the Values area, Excel automatically sets
the default function to “Count”. So, if you have only text values in your
source list, you can still create a Pivot Table.

Show Totals as a percentage

When looking at data in a PivotTable, it may be useful to represent the data


not only as an aggregate number, but also a percentage of the overall total.
You can drag
multiple fields to
the values drop
area. You can
even drag the
same field
multiple times
and change the
summary
function.
For example,
this data shows
a Total revenue
generated by
each product,
but it may be nice to see not only the total dollar amount for each product,
but also the percentage of the column total.
When we drag the Revenue field to the Values area, Excel creates in the
pivot table a Sum of Revenue. If we drag it another time to the values area
(below the previous instance). The PivotTable will now display the Sum of
Revenue2 just like the figure.

www.OfficeInstructor.ca Page 27 of 53
Excel Pivot Tables From Zero To Hero

Right
Click
menu

To change the display of the second Salary value to a percentage, right click
on a cell in the Sum of Revenue2 column, choose Show Values As and
then choose % of Column Total.

www.OfficeInstructor.ca Page 28 of 53
Excel Pivot Tables From Zero To Hero

The PivotTable will


now display the
Products, with the
Sum of Revenue
per Product, as well
as the percentage
of the Grand Total
Revenue.

Tip: Remember, it
is a good practice
to type a more
descriptive name to
the field header
rather than the
non-descriptive
names generated
by default.
Rename Column Field Names
The column field names are not very descriptive which can make it tough
for individuals to decipher what is being displayed. For example, in our
example, the column headings look like this;

When looking at the column headings a more descriptive name, especially


the Sum of Revenue2 column, would be very beneficial. To change a
heading name, simply click on the cell and type in a new name.

www.OfficeInstructor.ca Page 29 of 53
Excel Pivot Tables From Zero To Hero

This can be done on any field name within a PivotTable (column headings
from the original data), but the columns cannot have the same name as a
PivotTable field name. For example, if the Sum of Revenue name was
changed to just Revenue, Excel would produce an error stating the field
name already exists.

Tip: To use the same name as an existing field name, add a space after the
name. The extra space won't be visibly noticeable and Excel will accept the
new name since it does not match a PivotTable field name exactly.

Sort a PivotTable
To sort the data in a column, position the cursor in the field to be sorted and
select either the
Ascending or
Descending Sort
icon from the
either Data Tab,
or the Home Tab,
editing group.
A multi-level sort may be performed as long as there
are multiple levels within the PivotTable. To perform a multi-level sort, each
field within a field section will have to be sorted individually.
For example, if a PivotTable is set up with a Representative and a Region in
the Rows with the Revenue displayed in the Values area.

www.OfficeInstructor.ca Page 30 of 53
Excel Pivot Tables From Zero To Hero

To sort this data by Representative name and then by descending Region,

the Representative name must be sorted first. Position the cursor within a
cell of one of the Representatives’ names. Navigate to the Home Tab, click
on the Sort and filter button, and select the Sort A to Z option. This will only
sort the Representative name alphabetically.
To sort by the Regions for each Representative, select a cell containing a
Region name. Navigate to the Home Tab, click on the Sort and filter button,
and select the Sort Z to A option.
The data will not change the sort of the Representative names since the
Representative name is on a different level than the Region.

Note: This data could also be sorted by the Revenue, but that would
override the sort that was performed on the Representative names since
they are both on the same level within the PivotTable.

Tip: Although “Sorting” is not available on the Analyze or Design Tabs, you
can access the sorting options from within the Pivot Tables by doing one of
the following:
1- Select a value in the field you wish to sort. Right click and select a
sorting option.
2- In the Pivot Table Fields List, select the field you want to sort, click
on the down arrow which appears to the right side of the field name

www.OfficeInstructor.ca Page 31 of 53
Excel Pivot Tables From Zero To Hero

and select a sorting option. If you select “More Sort Options…” you
will be able to apply a Custom Sort.

Applying a Custom Sort


A custom sort does not follow the logical Alphabetical pattern. Say you want
a field to be organized in a specific pattern relevant to your business, you
need first to create a “Custom List”, then use this list as a model for sorting.
To create a “Custom List” click on the File Tab and select Options. Select
“Advanced” and scroll down to the lower third of the window and click on
“edit Custom Lists…” : The “Custom Lists” dialog box opens.

In the Custom Lists dialog box type your values in the right side in the order
you like (Alternatively you can import them from the worksheet), and click
Add then OK. Then hit OK to close the Excel Options dialog box.

www.OfficeInstructor.ca Page 32 of 53
Excel Pivot Tables From Zero To Hero

Now you can use your newly created


Custom List as a pattern to follow when
sorting a Pivot Table.

To use your Custom List. Click on the


down arrow to the right of the Pivot
Table Field name in the Pivot Table Field
list and select “More Sort Options…”
The Sort dialog box opens. From the
lower left corner click on “More
Options…”

In the More Options dialog box select


Ascending or Descending and then
click “More Options”.
The More Sort Options(Field name) opens. In this dialog box, remove the
check from “Sort Automatically every time the report is updated”.

www.OfficeInstructor.ca Page 33 of 53
Excel Pivot Tables From Zero To Hero

Under “First key sort order” click on the down arrow and select your Custom
List”. Hit OK twice.

Your Pivot Table field is now sorted following your Custom List.

www.OfficeInstructor.ca Page 34 of 53
Excel Pivot Tables From Zero To Hero

Expand/Collapse Data
If the data within a Pivot Table has multiple fields within a Row area, there
will be a small (minus) or a small + (plus) button that will display to the
left of the top-Level fields.

The plus or minus buttons indicate if the data is collapsed (plus) or


expanded(minus). To expand or collapse a field, click on the plus or minus
button to the left of the field names in the PivotTable. This enables you to
collapse and focus on high level information, or expand and drill down into
details.

Another way to expand or collapse the data is to place the cursor in the field
to expand or collapse. Navigate to the PivotTable Analyze Tab, and then
click on either the Expand or Collapse icons that are located in the Active
Field group, on the left side of the ribbon.

www.OfficeInstructor.ca Page 35 of 53
Excel Pivot Tables From Zero To Hero

Drill Down
A PivotTable is a summary of
data that may represent one or
many records from the original
data. Drill down is a feature that
will display the individual data
that makes up that summarized
data and display that data on a
new sheet.

In the example above, each Region is displayed with the total Revenue
within that Region. The drill down feature can be used to display ALL the
individual transactions that created that total. To see a list of transactions
from an individual Region, double click on one of the cells that contains a

Total Revenue.
Excel will insert a new sheet to the right of the currently selected sheet which
will display the individual data that makes up the summary of the cell that
was clicked on.
Note: If the data in the PivotTable changes, the drill down sheets will not
update, even if the Refresh all button on the PivotTable Tools, Analyze Tab
is selected.

Tip: The Drill down feature can be used to Re-Create the entire source list.
If you create a Pivot Table by dragging only “Revenue” to the Values area.

www.OfficeInstructor.ca Page 36 of 53
Excel Pivot Tables From Zero To Hero

Copy this Pivot Table to a New workbook (where there is NO source list). If
you double click on the “Sum of Revenue”, you will re-create the source list.

Moving a Pivot Table


After creating a Pivot Table, you might want to move it either in the same
sheet or on a new sheet.
To do that, click on the Analyze Tab of the ribbon, then click on Move
PivotTable.

The Move PivotTable dialog box opens. Make your selection to the
destination:
• New Worksheet
• Existing Worksheet. Select a cell and hit OK.

Tip: You might need to adjust the column width after moving the Pivot
Table.

www.OfficeInstructor.ca Page 37 of 53
Excel Pivot Tables From Zero To Hero

Grouping Data by Date/Time

PivotTables have the ability to Group Selections by date and time.


1. Start by positioning the cursor in a column containing a date or time.
2. Navigate to the PivotTables Analyze tab

3. Select Group Field.

www.OfficeInstructor.ca Page 38 of 53
Excel Pivot Tables From Zero To Hero

4. Verify that the Start and End dates are correct in the Grouping
window and then select the data to group on from the By section of
the Grouping window.
5. Click on the OK button.
Note: Grouping may be done on multiple data points; Months and Years,
Days and Months, etc.
To remove grouping, navigate to the PivotTables Tools Analyze tab and
select the Ungroup Data button.

Tip: Grouping options are also


located in the context
sensitive menu when
you right click your mouse on
the date data.

Tip: In Office 2016, when you


drag a date field to the rows
area, it is automatically
grouped into years with
expand symbols. Clicking on
the expand symbols will drill down into quarters then Months.

Tip: If you drag a transactional date to the Rows area in Office 2016,
grouping is done by Year, Quarter and Month. You may drag one of these
Fields back to the Pivot Tables Fields List and keep only those fields you
want, e.g. Year & Month.

Tip: You can turn off automatic grouping by going to the File Tab and select
Options. On the Advanced page of the Excel Options dialog box, scroll
down to the “Data” section and check the box for “Disable automatic
Grouping of Date/Time columns in PivotTables. See figure below

www.OfficeInstructor.ca Page 39 of 53
Excel Pivot Tables From Zero To Hero

PivotTable Timeline
The Timeline feature, which was introduced in Excel 2013, allows users to
filter a PivotTable by using a Timeline. In order to use the Timeline feature,
the data must have dates.

www.OfficeInstructor.ca Page 40 of 53
Excel Pivot Tables From Zero To Hero

Start by selecting a cell that contains a date. Navigate to the PivotTable


Analyze Tab, and then click on the Insert Timeline Icon.

Excel will display any fields that are available to use with the Timeline feature
on the Insert Timelines window. Place a checkmark in the box next to the
field name to add to the timeline, and then click OK.

Note: To change the size of the timeline, make sure the timeline is
selected and then click, hold and drag on one of the sizing handles to
resize the
timeline.
The timeline will
appear on the
sheet displaying
the data in a
time period,
dependent on
the data that is
selected, Year,
Months, Days, Hours, etc.
On the upper right side of the timeline, the time period will display how the
data is filtered on the timeline. To change the time period, click on the drop-
down list and selecting the appropriate option.

www.OfficeInstructor.ca Page 41 of 53
Excel Pivot Tables From Zero To Hero

To filter the timeline into a specific time period, click on the timeline bar to
select a range to filter the data. As options are selected on the timeline bar,
the data in the PivotTable updates to reflect the time periods that are
selected.

Click To
Clear
Filter

Drag To
Change Time
Frame

To select a range on the timeline, click, hold and drag on the blue bar to
make a larger selection.
When a Timeline is inserted, the Options Tab is added to the ribbon. On
the Options Tab you have commands to customize the Timeline and apply a
Style.

Creating a Calculated Field


A calculated field is a manually created field within a PivotTable that is
used to preform calculations.

www.OfficeInstructor.ca Page 42 of 53
Excel Pivot Tables From Zero To Hero

The calculated field must reside in the data area. The formulas used are
stored in a dialog box and stored within the PivotTable data.

To create a calculated field, make sure the cursor is within the PivotTable.
Navigate to the
PivotTable Analyze
Tab, click on the
Fields, Items & Sets
drop down and then
select Calculated
Fields.
On the Calculated
Field dialog box,
provide a name the
new field in the Name
textbox. Navigate to
the Formula textbox and place the cursor just after the equal (=) sign. To
add a field into the formula, double click on the field name from the list of
Fields in the lower left side of the
window. After adding in a field name,
make sure to manually add in a
mathematic symbol ( = , - , * , / , etc.)
to perform a calculation with the data
in the fields. Click OK when the
formula is complete.

www.OfficeInstructor.ca Page 43 of 53
Excel Pivot Tables From Zero To Hero

The formula I created for this example is: Profit= Revenue*0.35

The new column will be added to the right of the PivotTable, with the
result of the formula displayed as Sum of Profit

Edit a Calculated Field


To edit a calculated field, make
sure the cursor is within the
PivotTable. Navigate the
PivotTable Analyze Tab, click on
the Fields, Items & Sets drop
menu and select the Calculated
Field.
On the Insert Calculated Field
window, click on the dropdown
on the right side of the Name textbox to display and select the calculated
field.
The Formula for
the calculated field
will appear in the
Formula text box
where any
additions,
deletions, etc. may
be made to the
fields, type of calculation, etc.
When the changes have been made, click on the OK button to update the
field.
I edited my previous formula to become: COGS= Revenue*0.65

www.OfficeInstructor.ca Page 44 of 53
Excel Pivot Tables From Zero To Hero

Tip: In our example I created first a calculated field for Profit, by multiplying
the Revenue by 35%. I then modified that field by changing the name to
COGS (Cost of Goods Sold) and change the calculation to =Revenue*65%.
If you edit a Calculated field and click Add, you are just creating a new one.
The edited field still exist, to delete it, select it and hit Delete.

Printing PivotTables
Insert a Page Break after a Row Label
If the data in the PivotTable has more than
one row label, meaning there are multiple
categories on the left side of a PivotTable, a
page break may be inserted at each Row label
so when the PivotTable is printed, each new
category will have its own page.
To add a page break after each new row item,
right click one of the names within the
category and then select Field settings. On

www.OfficeInstructor.ca Page 45 of 53
Excel Pivot Tables From Zero To Hero

the left side of the Analyze Tab. You can also Right-click and select Field
Settings.
For example, to print a new page for each new Region, right click on one of
the Region names and then select Field Settings.
Tip: The Field Settings tool is also located on the PivotTable Design tab.

Right Click
and select
Field Settings

On the Field Settings dialog box, select the Print and Layout tab. On the
bottom of the dialog box under the Print section, place a checkmark next to
the Insert page break after each item option. Any time the row name
changes, a new page will print.

Print Titles in a Report


By default, the Titles on the top of a PivotTable will only print on the first
page.

www.OfficeInstructor.ca Page 46 of 53
Excel Pivot Tables From Zero To Hero

To print the column headings on the top every printed page, right click within
the PivotTable and select PivotTable Options from the Menu.

Tip: PivotTable Options is also located on the PivotTable Analyze Tab,


PivotTable Options drop-down menu.
On the PivotTables Options dialog box, select the Print Tab. Select the
check box next to Set print titles and then Click OK. This will make the
first row repeat on each page that is printed.

www.OfficeInstructor.ca Page 47 of 53
Excel Pivot Tables From Zero To Hero

Insert a PivotTable Chart


Data in a PivotTable can easily
be converted to a PivotChart for
a better visual display. To insert
a PivotChart, make sure the
cursor is within the PivotTable
and then select the
PivotChart button in the Tools
Group of the Analyze Tab.
The Insert Chart window will
appear which will display all of
the chart options that are
available. To view a preview of
a chart, click on the chart type
on the left-hand side.

When the correct chart is selected, click the OK button to add the chart to
the worksheet.
When a PivotChart is selected,
the PivotChart Tools Tabs
appear on the ribbon.

Edit a PivotChart
When a PivotChart is selected,
there will be two icons that
appear on the upper right side
of the chart. These icons can
be used to add in chart
elements, change the color or
style, etc. of a chart.
Chart Element
The plus icon allows Chart Elements, chart
title, data labels, etc. to the chart. To add
an element to the chart, place a checkmark
next to the element name. The contents of
the Chart Elements menu differ according
to the typr of chart you selected.

www.OfficeInstructor.ca Page 48 of 53
Excel Pivot Tables From Zero To Hero

Chart Style

The paintbrush icon, will include options for


the Chart Styles and the chart colors.

Note: Each chart type will display the styles


differently. Remember to use the scrollbar to
see all options that are available for a
particular chart type.

To change the color of the chart, click on the


Color Tab to select a new color scheme.

Change Chart Type

www.OfficeInstructor.ca Page 49 of 53
Excel Pivot Tables From Zero To Hero

To change the chart type, make sure the PivotChart is selected, navigate to
the Design Tab, and then select the Change Chart Type Icon.
On the Change Chart type window, select the appropriate chart type and
then click OK to change the chart.

Slicer Tool
The Slicer tool is used to filter the data in PivotTable/PivotChart. The Slicer
tool is a visual way of filtering data, vs using a filter dropdown menu. If you
have a Slicer applied to a field that was added to the filter drop area, both
the slicer and filter are interconnected, changes done on one of them reflect
on the other.

Insert Slicer

To insert a Slicer, make sure the cursor


is within the PivotTable. Navigate to
the PivotTable Analyze Tab and then
click on the Insert Slicer button. In
this example I’ll add a Slicer to the
Region & Color.

www.OfficeInstructor.ca Page 50 of 53
Excel Pivot Tables From Zero To Hero

The Insert Slicers window will appear which will display all fields that are in
the PivotTable. Place a checkmark next to the field(s) to add that slicer
and then click OK.
Excel will populate a new slicer, in its own window, for each field that was
selected. A Slicer Options Tab is automatically added to the Ribbon

To use the slicers, simply click on the item to display. When an item is
selected (highlighted) the PivotTable will update to reflect what was
selected.
To select multiple items from a slicer, click on the first item, press and hold
the Ctrl key and then click on the next item.
To remove a slicer filter and display all items on the slicer, click on the
Clear Filter icon on the upper right side of the slicer.

www.OfficeInstructor.ca Page 51 of 53
Excel Pivot Tables From Zero To Hero

To add a new slicer,


make sure the cursor is
within the PivotTable or
the PivotChart is
selected. Navigate to the
Analyze tab and click on
the Insert Slicer icon,
place a checkmark next to the field to be added and then click OK.
Tip: On the
Slicer Options
TAB you can
change the
Slicer Color by
applying a
Style, you can
change the
number of
columns, size of
the buttons and size of the slicer itself.

Tip: Slicers can be linked to multiple Pivot Tables by clicking on Report


Connections
on the
Options Tab,
then in the
dialog box
that pops-up
check the
pivot tables to which you
want to connect.
Delete a Slicer
To delete a slicer, click on
the slicer to select it and hit the delete key. Alternatively you can right click
on the slicer and select Remove (Field Name)

www.OfficeInstructor.ca Page 52 of 53
Excel Pivot Tables From Zero To Hero

Tip: Slicers are extensively used when creating a Dashboard (a single


window easy to use interactive report). You can create as many slicers, resize
them, reposition them and link them together.

www.OfficeInstructor.ca Page 53 of 53

S-ar putea să vă placă și