Learn Excel Pivot Tables
Learn Excel Pivot Tables
Learn Excel Pivot Tables
Tables
Tutorial
PivotTable is an extremely powerful tool that you can use to
slice and dice data. In this tutorial, you will learn these
PivotTable features in detail along with examples. By the
time you complete this tutorial, you will have sufficient
knowledge on PivotTable features that can get you started
with exploring, analyzing, and reporting data based on the
requirements.
FREE EBOOKs
Thank you!
TABLE OF CONTENTS
CREATING A PIVOTTABLE
You can create a PivotTable from a range of data or an
Excel table. You can start with an empty PivotTable to fill
in the details, if you are aware of what you are looking for.
You can also make use of Excel Recommended PivotTables
that can give you heads up on the PivotTable layouts that are
best suited for summarizing your data.
SUMMARIZING VALUES
Once you collate the data required by you by the different
exploration techniques, the next step that you would like to
take is to summarize the data. Excel provides you with a
variety of calculation types that you can apply based on
suitability and requirement. You can also switch across
different calculation types and view the results in a matter of
seconds.
UPDATING A PIVOTTABLE
Once you have explored the data and summarized it, you
need not repeat the exercise if and when the source data gets
updated. You can refresh the PivotTable so that it reflects
the changes in the source data.
You will learn the various ways of refreshing data in the
Chapter – Updating a PivotTable.
PIVOTTABLE REPORTS
After exploring and summarizing the data with a PivotTable,
you would be presenting it as a report. PivotTable reports
are interactive in nature, with the specialty that even a
person not familiar with Excel can use them intuitively.
Because of their inherent dynamic nature, they will enable
you to change the perspective quickly of the report to show
the required level of detail or to focus on the specific items
in which the audience expresses interest.
You can add fields to the PivotTable as you have seen in the
section – Adding Fields to the PivotTable, earlier in this
chapter.
PIVOTTABLE FIELDS
The PivotTable Fields list comprises of all the tables that are
associated with your workbook and the corresponding
fields. It is by selecting the fields in the PivotTable fields
list, you will create the PivotTable.
Above the fields list, you will find the action Choose fields
to add to report. To the right, you will find the button
As you can observe in the above Fields list, the Sort order is
by default – i.e. in Data Source Order. This means, it is the
order in which the columns in your data table appear.
• ROWS.
• COLUMNS.
• FILTERS.
• ∑ VALUES (Read as Summarizing Values).
ROWS
If you select the fields in the PivotTable Fields lists by just
checking the boxes, all the nonnumeric fields will
automatically be added to the ROWS area, in the order you
select.
∑ VALUES
The primary use of a PivotTable is to summarize values.
Hence, by placing the fields by which you want to
summarize the data in ∑ VALUES area, you arrive at the
summary table.
FILTERS
The Filters area is to place filters in PivotTable. Suppose
you want to display results separately for the selected
regions only.
Check boxes will appear for all the options in the dropdown
list. By default, all the boxes are checked.
• Sort A to Z.
• Sort Z to A.
• More Sort Options.
SORTING ON SUBTOTALS
Suppose you want to sort the PivotTable based on total
order amount – highest to lowest in every Region. That is,
you want to sort the PivotTable on subtotals.
You can see that there is no arrow for subtotals. You
can still sort the PivotTable on subtotals as follows −
You can also sort the PivotTable based on the total amount
month wise as follows −
Click on the East and drag it to the top. While you are
dragging East, a horizontal green bar appears across the
entire row moves.
Repeat the dragging with other items of the Region field
until you get the required arrangement.
You can observe the following −
More Sort Options (Region) dialog box appears. You can set
more sort options in this dialog box.
Under AutoSort, you can check or uncheck the box - Sort
automatically every time the report is updated, to allow or
stop automatic sorting whenever the PivotTable data is
updated.
You can create your custom lists from the FILE tab on the
Ribbon. FILE → Options. In the Excel Options dialog box,
click on advanced and browse to General. You will find the
Edit Custom Lists button next to Create lists for use in sort
and fill sequences.
Note that a custom list sort order is not retained when you
update (refresh) data in your PivotTable.
Then check the boxes - South and West and click OK.
The data pertaining to South and West regions only will get
summarized.
In the cell next to the Filter Region - (Multiple Items) is
displayed, indicating that you have selected more than one
item. However, how many items and / or which items is not
known from the report that is displayed. In such a case,
using Slicers is a better option for filtering.
MANUAL FILTERING
You can also filter the PivotTable by picking the values of a
field manually. You can do this by clicking on the
arrow in the Row Labels or Column Labels cell.
Suppose you want to analyze only February data. You need
to filter the values by the field Month. As you can observe,
Month is part of Column Labels.
If all the values of the field are not visible in the list, drag
the handle in the bottom-right corner of the dropdown to
enlarge it. Alternatively, if you know the value, type it in the
Search box.
FILTERING BY TEXT
If you have fields that contain text, you can filter the
PivotTable by Text, provided the corresponding field label
is text-based. For example, consider the following Employee
data.
The data has the details of the employees – EmployeeID,
Title, BirthDate, MaritalStatus, Gender and HireDate.
Additionally, the data also has the manager level of the
employee (levels 0 – 4).
INSERTING SLICERS
Suppose you want to filter this PivotTable based on the
fields – Region and Month.
• Click on ANALYZE under PIVOTTABLE TOOLS
on the Ribbon.
• Click on Insert Slicer in the Filter group. The Insert
Slicers dialog box appears. It contains all the fields
from your data table.
• Check the boxes Region and Month.
• Click OK.
Slicers for each of the selected fields appear with all the
values selected by default. Slicer Tools appear on the
Ribbon to work on the Slicer settings, look and feel.
FILTERING WITH SLICERS
As you can observe, each slicer has all the values of the field
that it represents and the values are displayed as buttons. By
default, all the values of a field are selected and hence all the
buttons are highlighted.
REMOVING A SLICER
Suppose you want to remove the slicer for the Region field.
• Slicer Caption
• Slicer Settings
• Report Connections
• Selection Pane
SLICER CAPTION
You can find the Slicer Caption box in the Slicer group. The
Slicer Caption is the header that is displayed on the slicer.
By default, Slicer Caption is the name of the field that it
represents.
SLICER SETTINGS
You can use Slicer Settings to change the name of the slicer,
change the slicer caption, choose whether to display the
slicer header or not and set the sorting and filtering options
for the items −
• Source Name.
• Name to use in formulas.
• Name.
• Header – Caption.
• Display header.
• Sorting and Filtering options for the items displayed
on the slicer.
REPORT CONNECTIONS
You can connect different PivotTables to a Slicer, provided
one of the following holds good −
• The PivotTables are created using the same data.
• One PivotTable has been copied and pasted as an
additional PivotTable.
• Multiple PivotTables are created on separate sheets
with Show Report Filter Pages.
SELECTION PANE
You can switch the display of the slicers on the worksheet
off and on using the Selection Pane.
If you know how your data is structured, you can place the
fields in the required order. If you are not sure about the
structure of the data, you can change the order of the fields
that instantly changes the layout of the PivotTable.
In this chapter, you will understand the nesting order of the
fields and how you can change the nesting order.
As you can see, in the rows area there are two fields –
salesperson and region in that order. This order of the fields
is called nesting order i.e. Salesperson first and Region next.
ANALYZE COMMANDS
The commands on the Ribbon of ANALYZE tab include the
following −
PIVOTTABLE OPTIONS
You can set the PivotTable Options according to your
preferences.
SUM
Consider the following PivotTable wherein you have the
summarized sales data regionwise, salesperson-wise and
month-wise.
As you can observe, when you drag the field Order Amount
to ∑ VALUES area, it is displayed as Sum of Order
Amount, indicating the calculation is taken as Sum. In the
PivotTable, in the top-left corner, Sum of Order Amount is
displayed. Further, Grand Total column and Grand Total
row are displayed for subtotals field-wise in rows and
columns respectively.
AVERAGE
Suppose you want to summarize the PivotTable by average
values of Order Amount region wise, salesperson wise and
month wise.
• Deselect Account.
• Drag Order Amount to ∑ VALUES area. The Sum
of Order Amount will be displayed in the ∑
VALUES area.
• Click on Sum of Order Amount.
• Click on Value Field Settings in the dropdown list.
The Value Field Settings dialog box appears.
• In the Summarize value field by box, click on
Average. The Custom Name changes to Average of
Order Amount.
• Click OK.
DELETING A PIVOTTABLE
You can delete a PivotTable as follows −
HIERARCHIES
You have learnt how to nest fields to form a hierarchy, in
the Chapter – Nesting in a PivotTable in this tutorial. You
have also learnt how to group / ungroup data in a PivotTable
in the Chapter – Using PivotTable Tools. We will take few
examples to show you how to produce interactive
PivotTable reports with hierarchies.
Create a PivotTable.
REPORT FILTER
Suppose you want a report for each Salesperson separately.
You can do it as follows −
SLICERS
Another sophisticated feature that you have in PivotTables
is Slicer that can be used to filter the fields visually.
TIMELINE IN PIVOTTABLE
When you have a Date field in your PivotTable, inserting a
Timeline also is an option to produce an aesthetic report.
DESIGN COMMANDS
The PIVOTTABLE TOOLS - DESIGN commands on the
Ribbon provide you with the options to format a PivotTable,
including the following −
• Layout
• PivotTable Style Options
• PivotTable Styles
LAYOUT
You can have PivotTable Layout based on your preferences
for the following −
• Subtotals
• Grand Totals
• Report Layout
• Blank Rows
REPORT LAYOUT
You can choose from the several Report Layouts, the one
that best suits your data.
• Compact Form.
• Outline Form.
• Tabular Form.
You can also choose whether to repeat all the item labels or
not, in case of multiple occurrences.
The default Report Layout is the Compact form that you are
familiar with.
Compact Form
BLANK ROWS
To make your PivotTable Report more distinct, you can
insert a blank line after each item. You can remove these
Blank Lines anytime later.
• Row Headers
• Column Headers
• Banded Rows
• Banded Columns
By default, the boxes for Row Headers and Column Headers
are checked. These options are for displaying special
formatting for the first row and the first column
respectively. Check the box Banded Rows.
Check the box Banded Columns.
PIVOTTABLE STYLES
You can choose several PivotTable Styles. Select the one
that suits your report. For example, if you choose Pivot
Style Dark 5, you will get the following style for the
PivotTable.
CONDITIONAL FORMATTING IN PIVOTTABLE
You can set Conditional Formatting on the PivotTable cells
by the values.
PIVOTCHARTS
PivotCharts add a visual emphasis on your PivotTable
reports. You can insert a PivotChart tied to the data of a
PivotTable as follows −
Thank you!