Excel Pivot Tables
07/02/2025 1
Objectives
• Summarize data using Microsoft Excel Pivot Table
• Analyze data using Microsoft Excel Pivot Table
• Explore data using Microsoft Excel Pivot Table
• Present data using Microsoft Excel Pivot Table
07/02/2025 2
Pivot Tables
• A Pivot Table is a powerful tool in Excel used to calculate, summarize,
and analyze data. It allows you to see comparisons, patterns, and
trends in your data. Pivot Tables function slightly differently
depending on the platform you are using to run Excel.
07/02/2025 3
Create a PivotTable in Excel for Windows
1. Select the cells you want to create a Pivot Table from.
2. Select Insert > PivotTable.
3. This creates a PivotTable based on an existing table or
range.
4. Choose where you want the PivotTable report to be placed.
Select New Worksheet to place the PivotTable in a new
worksheet or Existing Worksheet and select where you
want the new PivotTable to appear.
5. Select OK.
07/02/2025 4
Data format tips and tricks
•Use clean, tabular data for best results.
•Organize your data in columns, not rows.
•Ensure all columns have headers with a single row of unique,
non-blank labels for each column. Avoid double rows of
headers or merged cells.
•Format your data as an Excel table: Select anywhere in your
data, and then select Insert > Table from the ribbon.
•If you have complicated or nested data, use Power Query to
transform it (for example, to unpivot your data) so it's
organized in columns with a single header row.
07/02/2025 5
Create a PivotTable From Other Sources
1. By clicking the down arrow on the button, you can select
from other possible sources for your PivotTable. In addition
to using an existing table or range, there are three other
sources you can select from to populate your PivotTable.
07/02/2025 6
Build out your PivotTable
• To add a field to your PivotTable, select the field name
checkbox in the PivotTables Fields pane.
• To move a field from one area to another, drag the field to
the target area.
Note: Selected fields are added to their default areas: non-numeric fields are added
to Rows, date and time hierarchies are added to Columns, and numeric fields are
added to Values.
07/02/2025 7
Refreshing PivotTables
•Single PivotTable: If you add new data to your PivotTable data source
and need to refresh just one PivotTable, right-click anywhere in the
PivotTable range, and then select Refresh.
•Multiple PivotTables: If you have multiple PivotTables and want to
refresh all of them:
• Select any cell in any PivotTable.
• On the ribbon, go to PivotTable Analyze.
• Click the arrow under the Refresh button.
• Select Refresh All.
07/02/2025 8
Refreshing PivotTables
Warning: Data Format Consistency
•Potential Issues: If the data formats change (e.g., from text to
number, date format changes, etc.), it may lead to errors during the
refresh.
•Best Practices:
• Ensure that the data formats remain consistent in the
source data.
• Before refreshing, check for any changes in the data format
to avoid unexpected results or errors.
Action Steps:
•Regularly validate the data types in your source data.
•Keep documentation of any changes made to the data structure.
07/02/2025 9
Working with PivotTables Values
Summarize Values By
•By default, PivotTable fields placed in the Values area are displayed as a SUM. If Excel
interprets your data as text, it will be displayed as a COUNT. Therefore, it is crucial to
ensure that you don't mix data types for value fields.
•To change the default calculation:
• Select the arrow to the right of the field name in the Values area.
• Choose Value Field Settings from the dropdown menu.
• In the Summarize Values By section, select your preferred calculation method
(e.g., Average, Max, Min, etc.).
•Note that when you change the calculation method, Excel automatically appends it in
the Custom Name section, such as "Sum of FieldName." You can modify this name if
needed.
•To change the number format for the entire field:
• Select Number Format within the Value Field Settings dialog box.
• Choose your desired number format and apply it.
07/02/2025 10
Working with PivotTables Values
Show Values As
•Display as Percentage: Instead of summarizing data with a calculation, you
can display it as a percentage of a field. For example, you might change
household expense amounts to display as a % of Grand Total instead of the
sum of the values.
•To configure this:
• Open the Value Field Settings dialog box.
• Select the Show Values As tab.
• Choose the percentage option you want (e.g., % of Grand Total, %
of Column Total, etc.).
•Display Both Calculation and Percentage:
• To show a value as both a calculation and a percentage, drag the
item into the Values section twice.
• Set the Summarize Values By option for the first instance and
configure the Show Values As option for the second instance to
display it as a percentage.
07/02/2025 11
Create formulas in a PivotTable
•Calculated Field vs. Calculated Item:
•Calculated Field: Use this when you want to create a formula that utilizes data
from other fields in the PivotTable.
•Calculated Item: Use this when you need a formula that works with data from
one or more specific items within a field.
•Calculated Items:
•You can enter different formulas for each cell.
•For example, if you have a calculated item named OrangeCounty with a
formula of =Oranges * 0.25 across all months, you can modify the formula to
=Oranges * 0.5 specifically for June, July, and August.
•Adjusting Order of Calculation:
•If you have multiple calculated items or formulas, you can adjust the order in
which they are calculated to ensure accurate results.
07/02/2025 12
Create formulas in a PivotTable
Add a calculated field
1. Click the PivotTable.
2. This displays the PivotTable Tools, adding
the Analyze and Design tabs.
3. On the Analyze tab, in the Calculations group, click Fields, Items, &
Sets, and then click Calculated Field.
4. In the Name box, type a name for the field.
5. In the Formula box, enter the formula for the field.
6. To use the data from another field in the formula, click the field in
the Fields box, and then click Insert Field. For example, to calculate a
15% commission on each value in the Sales field, you could enter =
Sales * 15%.
7. Click Add
07/02/2025 13
Create formulas in a PivotTable
Add a calculated item to a field
1. Click the PivotTable.
2. This displays the PivotTable Tools, adding the Analyze and Design tabs.
3. If items in the field are grouped, on the Analyze tab, in the Group group,
click Ungroup.
4. Click the field where you want to add the calculated item.
5. On the Analyze tab, in the Calculations group, click Fields, Items, & Sets,
and then click Calculated Item.
6. In the Name box, type a name for the calculated item.
7. In the Formula box, enter the formula for the item.
8. To use the data from an item in the formula, click the item in
the Items list, and then click Insert Item (the item must be from the
same field as the calculated item).
9. Click Add.
07/02/2025 14
View all formulas that are used in a PivotTable
1. Click the PivotTable.
2. This displays the PivotTable Tools, adding the Analyze and Design tabs.
3. On the Analyze tab, in the Calculations group, click Fields, Items, & Sets,
and then click List Formulas.
07/02/2025 15
Edit a PivotTable formula
1.Determine the Formula Type:
•Identify whether the formula is part of a calculated field or a calculated item.
2.Click the PivotTable:
•This action displays the PivotTable Tools, adding the Analyze and Design tabs to the
ribbon.
3.Open List Formulas:
•On the Analyze tab, in the Calculations group, click Fields, Items, & Sets.
•Then select List Formulas from the dropdown menu.
4.Locate the Formula:
•In the list of formulas, find the one you want to change under Calculated Field or
Calculated Item.
•For calculated items, if there are multiple formulas, the default formula will show the
calculated item name in column B. Additional formulas will display both the calculated item
name and the names of intersecting items.
•Example: You might have a default formula for a calculated item named MyItem, and
another formula for this item identified as MyItem January Sales. In the PivotTable, this
formula would appear in the Sales cell for the MyItem row and January column.
5.Edit the Formula:
•Use one of the following methods to modify the formula (not specified in the provided text;
generally, involves selecting the formula and making changes directly or using the formula
editor).
07/02/2025 16
Create a PivotChart
07/02/2025 17
Create a PivotChart
Sometimes it's hard to see the big picture when your raw data hasn’t been
summarized. Your first instinct may be to create a PivotTable, but not
everyone can look at numbers in a table and quickly see what's going on.
Pivot Charts are a great way to add data visualizations to your data.
1. Select a cell in your table.
2. Select Insert and choose Pivot Chart button PivotChart.
3. Select where you want the PivotChart to appear.
4. Select OK.
5. Select the fields to display in the menu.
Create a chart from a PivotTable
1. Select a cell in your table.
2. Select Insert and choose PivotChart.
3. Select a chart.
4. Select OK.
07/02/2025 18
Create a Slicer
07/02/2025 19
Use slicers to filter data
You can use a slicer to filter data in a table or PivotTable with ease.
1. Click anywhere in the table or PivotTable.
2. On the Insert tab, select Slicer.
3. Insert Slicer
4. In the Insert Slicers dialog box, select the check boxes for the fields you want to display,
then select OK.
5. A slicer will be created for every field that you selected. Clicking any of the slicer buttons
will automatically apply that filter to the linked table or PivotTable.
Format a slicer
1. You can adjust your slicer preferences in the Slicer tab (in newer versions of Excel), or the
Design tab (Excel 2016 and older versions) on the ribbon.
2. On the Slicer or Design tab, select a color style that you want.
Make a slicer available in another PivotTable
1. First create a PivotTable that is based on the same data source as the PivotTable that already has the slicer
want to reuse.
2. Select the slicer that you want to share in another PivotTable. This displays the Slicer tab.
3. On the Slicer tab, select Report Connections.
4. In the dialog box, select the check box of the PivotTable in which you want the slicer to be available.
07/02/2025 20
Create a PivotTable timeline to
filter dates
07/02/2025 21
Timeline to filter dates
Instead of adjusting filters to show dates, you can use a PivotTable Timeline—a dynamic filter
option that lets you easily filter by date/time and zoom in on the period you want with a slider
control. Click Analyze > Insert Timeline to add one to your worksheet.
1. Click anywhere in a PivotTable to show the PivotTable Tools ribbon group, then click
Analyze > Insert Timeline.
2. In the Insert Timeline dialog box, check the date fields you want, and click OK.
Use a Timeline to filter by time period
With your Timeline in place, you’re ready to filter by a time period in one of four-
time levels (years, quarters, months, or days).
1. Click the arrow next to the time level shown and pick the one you want.
2. Drag the Timeline scroll bar to the time period you want to analyze.
3. In the timespan control, click a period tile and drag to include additional tiles to select the
date range you want. Use the timespan handles to adjust the date range on either side.
07/02/2025 22
Change the source data for a
PivotTable
07/02/2025 23
Change the source data for a PivotTable
• Click anywhere in your PivotTable report to activate it.
• On the Analyze tab, in the Data group, click Change Data Source, and then
select Change Data Source.
• The Change PivotTable Data Source dialog box will appear.
• To use an external data source, click Use an external data source, and then
click Choose Connection.
• The Existing Connections dialog box will be displayed.
• In the Show drop-down list at the top of the dialog box, select the category of
connections you want or choose All Existing Connections (the default).
• Select a connection from the Select a Connection list box, and then click
Open.
• Note: If your connection is not listed, refer to Manage Connections to Data
in a Workbook for more information.
• Click OK to apply the changes.
1. Note: If you choose a connection from the Connections in this Workbook category, you will be reusing
or sharing an existing connection. If you choose a connection from the Connection files on the network
or Connection files on this computer category, the connection file is copied into the workbook as a new
07/02/2025 24
workbook connection, and then used as the new connection for the PivotTable report.
Q&A
07/02/2025 25
Time to Apply
Hands-on
07/02/2025 26
Task
• Use an Excel dataset that includes fields such as Region, Product Category,
Sales Amount, and Date.
• Create a pivot table to summarize sales by region and product category.
• Use calculated fields to compute total and average sales.
• Group data by quarter or month to identify time-based trends.
• Challenge:
• Customize the pivot table with conditional formatting and filtering options
to highlight the top-performing product categories in each region.
07/02/2025 27
Thank You
07/02/2025 28