0% found this document useful (0 votes)
8 views

Data Analysis (Excel Pivot Table)[en]

This document serves as a comprehensive guide to using PivotTables in Excel, covering topics such as structuring source data, creating and manipulating PivotTables, formatting options, and advanced functionalities like calculated fields and conditional formatting. It includes step-by-step instructions and practical exercises to help users effectively analyze and summarize large datasets. The content is organized into chapters that progressively build on the skills needed to utilize PivotTables efficiently.

Uploaded by

biawakchann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Data Analysis (Excel Pivot Table)[en]

This document serves as a comprehensive guide to using PivotTables in Excel, covering topics such as structuring source data, creating and manipulating PivotTables, formatting options, and advanced functionalities like calculated fields and conditional formatting. It includes step-by-step instructions and practical exercises to help users effectively analyze and summarize large datasets. The content is organized into chapters that progressively build on the skills needed to utilize PivotTables efficiently.

Uploaded by

biawakchann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

[DOCUMENT TITLE]

[Document subtitle]
i

TABLE OF CONTENTS

CHAPTER PAGE
CHAPTER 1 PIVOTTABLE 101 1
1.1 Structuring Source Data 2
1.1.1 Data Table Structure 2
1.1.2 Correct Data Table Structure 3
1.1.3 How to create a Pivot Table? 3
1.2 Navigating the Field List 7
1.2.1 Pivot Table Field List 7
1.2.2 How to modify your Pivot Table field list? 7
1.3 Creating and Manipulating Table 9

CHAPTER 2 PIVOTTABLE FORMATTING 14


2.1 Conditional Formatting Values 14
2.1.1 The basic Way to Apply Conditional Formatting to a Pivot Table 14
2.1.2 Other way to apply Conditional Formatting to a Pivot Table 15
2.2 Applying Default & Custom Styles 21
2.2.1 Excel Pivot Default Style 21
2.3 Adjusting Table Layouts 22
2.3.1 Outline Form 22
2.3.2 Tabular Form 23
2.3.3 How to change the Pivot Table layout? 24

CHAPTER 3 SORTING, FILTERING & GROUPING 25


3.1 Sorting Data 25
3.1.1 How to sort data in Pivot Table? 25
3.2 Applying Label and Value Filters 27
3.3 Adding Wildcards 29
3.3.1 How to use wildcards in Pivot Table filter? 29
3.4 Grouping Values 30
3.4.1 How to group the data? 30
ii

CHAPTER 4 CALCULATED FIELDS & VALUES 31


4.1 Creating Calculated Fields & Items 32
4.1.1 How to add a calculated field to your Pivot Table? 32
4.1.2 How to remove a calculated field? 33
4.1.3 How to add a calculated item to your Pivot Table? 33
4.2 Summarizing Values 36
4.2.1 SUM 36
4.2.2 Value Field Settings 37
4.2.3 % of Grand Total 38
4.2.4 % of Column Total 40
4.2.5 % of Row Total 40
4.2.6 Count 41
4.2.7 Average 42
4.2.8 Max 45
4.2.9 Min 46
4.3 Applying Custom Calculations 47
4.3.1 How to apply custom calculation in your Pivot Table? 47

CHAPTER 5 EXERCISES 51
5.1 Tutorial 1: Converting Source Data for a Pivot Table 51
5.2 Tutorial 2: Creating a Pivot Table 52
5.3 Tutorial 3: Creating Multiple Types of PivotTable Information 53
5.4 Tutorial 4: Creating PivotTable Charts 56
5.5 Tutorial 5: Creating Simple Dashboard 57
Data Analysis With Excel Pivot Table 1

- CHAPTER 1 -
PIVOTTABLE 101

Objectives:

• Learn about PivotTable


• Learn how to create a PivotTable
• Learn how to prepare source data

PivotTable is an interactive way to quickly summarize large amounts of data, you can use a
PivotTable to:
• Analyze numerical data in detail
• Answers unanticipated questions about your data

Figure 1.1: Sample of a PivotTable


Data Analysis With Excel Pivot Table 2

A PivotTable designed for:


• Querying large amounts of data in many user-friendly ways
• Subtotaling and aggregating numeric data, summarizing data by categories and
subcategories, and creating custom calculations and formulas.
• Expanding and collapsing levels of data to focus your results, and drilling down to
details from the summary data for areas of interest to you.
• Moving rows to columns or columns to rows
• Filtering, sorting, grouping, and conditionally formatting the most useful and interesting
subset of data enabling you to focus on just the information you want.

6 Ways Hypothetical Scenarios Where You’d Want to use a Pivot Table:


1. Compare sales totals of different products
2. Show product sales as percentages of total sales
3. Combine duplicate data
4. Get an employee head count for separate department
5. Add default values to empty cells
6. Fine-tune your calculation

1.1 Structuring Source Data

1.1.1 Data Table Structure


Before you create a pivot table, organize your data into rows and columns, and create an
Excel Table. The following table show a sample of correct and in-correct data table:

Figure 1.2: Sample of Correct and incorrect data table


Data Analysis With Excel Pivot Table 3

1.1.2 Correct Data Table Structure


Following is the list component or term used in data table:
1. Fields – Columns that define the
values in the rows
2. Column Header – Name that
describes the data in the field
3. Data Records – Rows in the table
below the header that contain the
data
4. Record Set – One row off data
Figure 1.3: Data table component
that contains values for each field

In the original report format, the page and column headers are used to describe multiple
values (data point)

1.1.3 How to create a Pivot Table?


STEP 1: Enter your data into a range of rows and columns
Every pivot table in Excel starts with a basic Excel table. To create this table, simply enter your
values into a specific set of rows and columns.

Use the top row or the top column to categorise your values.
For example, to create “Excel table for blog post performance data”, you need to have "URL
listing”, "Post Title", "Views to Date," and “Publish Date” information.

Figure 1.4: Excel table for blog performance data


Data Analysis With Excel Pivot Table 4

STEP 2: Sort your data by a specific attribute


Sorting data is helpful when you have large amounts of data in a PivotTable or PivotChart. You
can sort in alphabetical order, from highest to lowest values, or from lowest to highest values.
Sorting is one way of organizing your data so it’s easier to find specific items.

How to sort your data?

Figure 1.5: Data > Sort button

Go to “Data” tab and select the “Sort” Button:

Figure 1.6: Extra dropdown option

You can sort the alphabetical order, cell values, URL, Post title, publish date or others
information you need.
Data Analysis With Excel Pivot Table 5

For example, if you want to sort the “number of views” data. Under the Sort by, you can choose
“Views to Date” option and set the order to “Smallest to Largest”. Then, click “OK”.

Figure 1.7: Example for Data Sorting

STEP 3: Highlight your cells to create your pivot table


Enter your data into a range of rows and columns and sort your data by a specific
attribute. Highlight your cells to create your pivot table.

Go to“Insert” tab, then click “PivotTable” icon.

Figure1.8: Pivot Table button


Data Analysis With Excel Pivot Table 6

This will open the Create PivotTable dialog box, you can choose where you want the Pivotable
report to be placed. After you select the “New Worksheet”, click "OK."

Figure 1.9: Choose where you want to put the Pivot Table
Data Analysis With Excel Pivot Table 7

1.2 Navigating the Field List

1.2.1 Pivot Table Field List


After you create a PivotTable, you'll see the Field List. You can change the design of the
PivotTable by adding and arranging its fields.

1.2.2 How to modify your Pivot Table field list?


Step 1: Click any cell in the pivot table
Step 2: The PivotTable Field List Pane will appear at the right side of the Excel window

Figure 1.10: Pivot Table Field List

Step 3: If the PivotTable Field List pane does not appear, go to “Analyze” tab and then click
the “Field List” Button.

Figure 1.11: Field List button


Data Analysis With Excel Pivot Table 8

Choose fields to add to report:


Step 1: Choose which data you want to
include in the PivotTable report
Change Step 2: For example, if you want to see a
the
Values post views report, click and drag “Post
Field Title” to Rows area.
Setting
Step 3: Your pivot table layout will auto
preview at the left side of the field list.

Figure 1.12: PivotTable Fields


Data Analysis With Excel Pivot Table 9

1.3 Creating and Manipulating Table

Original Report
ABC Co.
EMEA Region

Product Jan Feb Mar Apr


Product 1 1,000 2,000 3,000 4,000
Product 2 1,010 2,010 3,010 4,010
Product 3 1,020 2,020 3,020 4,020
Product 4 1,030 2,030 3,030 4,030
Total 4,060 8,060 12,060 16,060
Table 1.1: Original Report ABC Co. EMEA Region

For example (Table 1.1), the sales data table contains all sales amounts in the [Sales $]
column. With this format you could easily sum the column to produce the Total Sales $ for all
companies, regions, products, and months. You could then start filtering the columns to see
only the sales for one month and one region. A pivot table works the same way, and basically
filters your table based on criteria you specify in the filter fields.

The basic rule of the data structure is that all values of the same type need to be in one column.
This one rule should hopefully make it easier to quickly determine if your data is in the right
structure. If the data you are trying to analyze is spread out over multiple columns, then you
will likely need to convert it before creating a pivot table. In the “Original Report” above, the
Sales $ are in multiple columns by month (Jan – Apr). This one observation tells us that the data
is in the wrong structure.
Data Analysis With Excel Pivot Table 10

Types of Solution you can do to setting up your source data:

Solution: Unpivot with Power Query


Power Query is a free add-in from Microsoft for Excel 2010 and 2013 and also available for
Excel 2019, 2016 or in Office 365. You can find it in the “Data” ribbon under the button “Get &
Transform”.

You can import or connect to external data, and then shape that data, for example remove
a column, change a data type, or merge tables, in ways that meet your needs. Then, you can
load your query into Excel to create charts and reports. Periodically, you can refresh the data
to make it up-to-date.

STEP 1: Highlight your data, go to “Insert” tab and click Table button.

Figure 1.13: Data converted to table format

STEP 2: Go to Data tab > Get & Transform Data, click on From Table/Range button.

Figure 1.14: Get & Transform Data


Data Analysis With Excel Pivot Table 11

STEP 3: The Power Query Editor windows will pop-up. Highlight the data that you want to merge
into one column. For example, highlight the Apple column until Tea column.

Figure 1.15: To merge data

STEP 4: From the Power Query Editor, go to” Transform” tab and click on Unpivot Column button
to merge the data into one column.

Figure 1.16: Unpivot Column


Data Analysis With Excel Pivot Table 12

Merge data result:

Figure 1.17: Merge Data


Data Analysis With Excel Pivot Table 13

STEP 5: To close Power Query Editor, go to Home tab and click Close & Load.

Figure 1.18: Close & Load new converted data

STEP 6: Update the label to “Product” and “Qty”.

Figure 1.19: Source Data ready for Pivot Table


Data Analysis With Excel Pivot Table 14

- CHAPTER 2 -
PIVOTTABLE FORMATTING
Objectives:

• Learn how to apply multiple types of formatting on your Pivot Table


• Learn how to apply style
• Learn how to adjust table layouts

2.1 Conditional Formatting Values

Figure 2.1: Conditional Formatting button

In Excel, you can use conditional formatting to highlight cells, based on a set of rules. For
example, highlight the cells that are above average, or lower than a specific amount. After
applying conditional formatting to a pivot table, adjust the settings, to make sure that the
correct cells are formatted, after the pivot table is refreshed.

2.1.1 The basic Way to Apply Conditional Formatting to a Pivot Table

STEP 1: Select or highlight the data


STEP 2: Go to “Home” tab, click on conditional
formatting Button
STEP 3: Specify the rules and format.
STEP 4: Click OK.

Figure 2.2: List of formats in Conditional


Formatting
Data Analysis With Excel Pivot Table 15

2.1.2 Other way to apply Conditional Formatting to a Pivot Table

BEFORE

AFTER

Figure 2.3: Result before & after applying conditional formatting

2.1.2.1 Method 1: Using Pivot Table Formatting Icon

STEP 1: Select or highlight the data


STEP 2: Go to “Home” tab, click on
Conditional Formatting Button.
STEP 3: Specify the rules. For example,
Top/Bottom Rules > Above average.
STEP 4: Specify the Format. For example,
“Green Fill with Dark Green Text”.
STEP 5: Click OK.

Figure 2.4: Top/Bottom Rules & Above


Average calculation
Data Analysis With Excel Pivot Table 16

STEP 6: On the bottom right of the selected data set, you can see the Formatting Options icon:

Figure 2.5: Conditional Formatting Option

STEP 7: Click on that formatting option icon, it will show the drop-down list of:
• Selected Cells (which would be selected by default)
• All cells showing “sum of Revenue” values
• All cells showing “sum of revenue” values for “date” and “store”

Figure 2.6: Formatting Option Drop-down list


Data Analysis With Excel Pivot Table 17

Now when you add any data in the back end and refresh the pivot table, the additional data
would automatically be covered by conditional formatting.

BEFORE AFTER

Figure 2.7: Data before & after applying conditional formatting


Data Analysis With Excel Pivot Table 18

2.1.2.2 Method 2: Using Conditional Formatting Rules Manager


STEP 1: Select the data on which you want to apply conditional formatting.
STEP 2: Go to “Home” tab, click on Conditional Formatting button and choose Top/Bottom
Rules -> Above Average.
STEP 3: Specify the format (I am using “Green Fill with Dark Green Text”)

Figure 2.8: Specify Cells & Text format

STEP 4: Click OK. This will apply the conditional formatting to the selected cells
STEP 5: Go to “Home” tab, click on Conditional Formatting button, then click Manage Rules

Figure 2.9: Manage Rules


Data Analysis With Excel Pivot Table 19

STEP 6: In Conditional Formatting Rules Managers, select the rule you want to edit
STEP 7: Click Edit Rule button

Figure 2.10: Edit cells rules

STEP 8: From the Edit Formatting Rule windows, you will see three options:
• Selected Cells
• All cells showing “sum of Revenue” values
• All cells showing “sum of revenue” values for “date” and “store”

Figure 2.11: Edit Formatting Rule pop-up window


Data Analysis With Excel Pivot Table 20

STEP 9: Select the third option and click OK.

This will apply the conditional formatting to all the cells for ‘Date’ and ‘Store’ fields. Even if you
change the backend data (add more store data or date data), the conditional formatting
would be functional.
Data Analysis With Excel Pivot Table 21

2.2 Applying Default & Custom Styles

2.2.1 Excel Pivot Default Style


Compact form displays items from different row area fields in one column and uses
indentation to distinguish between the items from different fields.

3 Element in Compact Form (Default Layout):

Row Labels • Row Labels


o Each row label is in a separate row.
o It always above the labels for the inner
fields.
o It slightly intended, from the field above it,
to differentiate the fields.
Row
o It cannot be repeated.
Fields o The indentation can be changed, in
PivotTable Options, on the Layout &
Format tab

Subtotals

Figure 2.12: Compact Form (Default


Layout)

The Compact Form layout may be


useful when you:

• want to reduce the pivot


table width Figure 2.13: PivotTable Option to adjust
indentation at the second row
• don't need to about see the
individual Row field headings • Row Fields
o In Compact Form, all row fields are in a single
column.
o There is a generic heading, Row Labels, in
the Row Field column.

• Subtotals
o In Compact Form, Subtotals can be shown
at the top or bottom of each group.
o This setting affects all the Row fields.
o For Column fields, Grand Total are always
shown at the Bottom.
o The Row Label remains at the top, even if
Subtotals are at the bottom.
Data Analysis With Excel Pivot Table 22

2.3 Adjusting Table Layouts


There are several options for altering the layout of your PivotTable. The Layout group on the
Design tab allows you to change what elements appear on the PivotTable.

2.3.1 Outline Form


In Outline Form, each Row Field is in a separate column. There are two Row area: Column A
(Customer) and Column B (Date).

Figure 2.14: PivotTable Outline Form layout

Row Labels
• In Outline Form, each Row Label is in a separate row.
• The Row Label is always above the labels for the inner fields.
• The Row Labels can be repeated.

Row Fields
• In Outline Form, each Row field is in a separate column.
• Each Row Fields shows its name in the column heading.

Subtotals
• In Outline Form, Subtotals can be shown at the Top or Bottom of each group.
• This setting effects all the Row fields
• For Column Fields, Grand Totals are always shown at the Bottom
• The Row Label remains at the top, even if Subtotals are at the Bottom
Data Analysis With Excel Pivot Table 23

2.3.2 Tabular Form


In Tabular Form, each Row field is in a separate column. There are two Row area: Column A
(Customer) and Column B (Date).

The Tabular Form layout may be useful when you want to show all the field names as heading
labels and want to reduce the number of rows.

Figure 2.15: PivotTable Tabular Form Layout

Row Labels
• In Tabular Form, Row labels for the outer fields are on the same row as the first label for
the related inner fields.
• The Row labels can be repeated.

Row Fields
• In Tabular Form, each Row field is in a separate column.
• Each Row field shows its name in the column heading.

Subtotals
• In Tabular Form, Subtotals can only be shown at the Bottom of each group.
• This setting affects all the Row fields.
• For Column fields, Grand Totals are always shown at the Bottom.
Data Analysis With Excel Pivot Table 24

2.3.3 How to change the Pivot Table layout?


STEP 1: Go to “PivotTable Tools > Design” tab.
STEP 2: Click on Report Layout button
STEP 3: From the drop-down list, you can choose any type of pivot table layout you want to
apply such as Compact Form (Default layout), Outline Form or Tabular Form.

Figure 2.16: Modify the Report Layout


Data Analysis With Excel Pivot Table 25

- CHAPTER 3 -
SORTING, FILTERING & GROUPING

Objectives:
• Learn how to use sorting, filtering and grouping tools in pivot table
• Learn how to sort data
• Learn how to add wildcards
• Learn how to group data

3.1 Sorting Data


Sort Data function help you locate data that you want to analyze in a PivotTable more easily,
you can sort text entries (from A to Z or Z to A), numbers (from smallest to largest or largest to
smallest), and dates and times (from oldest to newest or newest to oldest).

3.1.1 How to sort data in Pivot Table?


STEP 1: Go to your PivotTable Field label. From
there, click the drop-down arrow button.

Figure 3.1: Drop-down arrow extra options


setting
Data Analysis With Excel Pivot Table 26

STEP 2: Select the option you want to apply


for your PivotTable data.

Figure 3.2: Sort by Alphabetical Order

Figure 3.3: Sort by highest/oldest to


lowers/Newest values & Vice Versa

STEP 3: Then, click OK.


Data Analysis With Excel Pivot Table 27

3.2 Applying Label and Value Filters


When you add fields to the pivot table row
and column areas, there are built-in filters in
the heading cells. Use those drop-down lists
Filter
to show or hide pivot items. With
programming, you can show or hide the
drop-down arrows. Change an option
setting to be able to apply multiple filters to
a field.

Search box

Check box to
hide/show
pivot item

Figure 3.4: Filter option

There are three types of filters that can be used in pivot table:

Label Filters
These filters allow you to filter relevant
data based on the field items (such as
filter specific item or item that contains a
specific text) or the values (such as filter
top 10 items by value or items with a
value greater than/less than a specified
value).

Figure 3.5: Label Filters


Data Analysis With Excel Pivot Table 28

Value Filters
You can filter items based on the
values in the columns in the values
area.

Figure 3.6: Value Filters > Top 10

Figure 3.7: Top/Bottom 10 Properties Window

Report Filter/ Manual Filters


After you summarised your data
by creating an Excel Pivot Table,
you can focus on specific portions
of the data by using Report Filters.
For example, instead of showing
information, you can select one or
Filter
two fields and show the results.

Figure 3.8: Filter Area in PivotTable Fields properties


Data Analysis With Excel Pivot Table 29

3.3 Adding Wildcards


Pivot Table allows you to filter by text wildcard characters and make your filtering dynamic.
You can use the row label filter and enter the text with wildcards to get the desired result.

Wildcards can take place of any character and the two wildcards that you can use while
filtering text in Pivot Table is:
• Asterisk (*) – to represent any series of characters
• Questions marks (?) – to represent any single characters

3.3.1 How to use wildcards in Pivot Table filter?


STEP 1: Click inside the pivot table field.
STEP 2: We will apply Wildcard filter for
“State” field to find any state with “n”
character.
Click on drop-down arrow under state
field  .
STEP 3: Click Label Filters.
STEP 4: Select “Begin with…”. Label Filter
(State) window will appear.
STEP 5: Type in “*n*”.

Figure 3.9: Label Filters > Begin with...

Figure 3.10: Label Filter (State)

STEP 6: Click OK.


Data Analysis With Excel Pivot Table 30

3.4 Grouping Values


Grouping data in a PivotTable can help you show a subset of data to analyse. For example,
you may want to group an unwieldy list of dates or times (date and time fields in the PivotTable)
into quarters and months.

3.4.1 How to group the data?

STEP 1: In the PivotTable, right-click a


value.
List of dates
STEP 2: Select group. before
grouping

1. In the Grouping box, select Starting


at and Ending at checkboxes, and edit
the values if needed.
2. List of dates
grouped by
3. Under By, select a time period. For
quarters and
numerical fields, enter a number that months

specifies the interval for each group.

Figure 3.11: Two data field that will be grouped

Figure 3.12: Grouping Options

STEP 3: Click OK.


Data Analysis With Excel Pivot Table 31

- CHAPTER 4 -
CALCULATED FIELDS & VALUES

Objectives:

• Learn how to create calculated fields & items in pivot table


• Learn how to summarizing values in pivot table
• Learn how to apply custom calculations in pivot table

A Pivot Table is used to summarise, sort, reorganise, group, count, total or average data stored
in a table. It allows us to transform columns into rows and rows into columns. It allows grouping
by any field (column), and using advanced calculations on them.

A pivot table can:


• group items/records/rows into categories
• count the number of items in each category,
• sum the items value
• or compute average, find minimal or maximal value etc.

When using a pivot table your source data will need to be in a tabular format. This means your
data is in a table with rows and columns.

• The first row should contain your column headings which describes the data directly
below in that column. There should be no blank column headings in your data.
• Each row after the column headings should pertain to exactly one record in your data.
For example, if your table contains customer data then each row might have the
name, street address, postal code and email address for exactly one customer.
Data Analysis With Excel Pivot Table 32

4.1 Creating Calculated Fields & Items


In a pivot table, calculated fields and calculated items are custom formulas.
• Calculated Fields used in pivot table formulas that refer to other fields in the pivot table
• Calculated Items use in pivot table formulas that refer to other items in a specific field

4.1.1 How to add a calculated field to your Pivot Table?


STEP 1: From the PivotTable too, click Analyze tab.
STEP 2: Under calculations, select Fields, Items & Sets and click “calculated field”.

Figure 4.1: Analyze Tab > Fields, Items & Sets


Figure 4.2: Calculated Fields command

STEP 3: “Insert Calculated Field” window will pop-up.


STEP 4: After you have done with all the setting, click on Add. You can see the new field appear
in the fields list.
STEP 5: Click OK.
Data Analysis With Excel Pivot Table 33

4.1.2 How to remove a calculated field?


STEP 1: Go to Analyze tab
STEP 2: Click Fields, Items, & Sets
STEP 3: Click calculated fields
STEP 4: Choose the option you want to delete
STEP 5: Then, press Delete.
STEP 6: Click OK

4.1.3 How to add a calculated item to your Pivot Table?


STEP 1: Click on the specific field you want to use
STEP 2: Go to Analyze tab
STEP 3: Click on Fields, Items, & Sets

Figure 4.3: Analyze > Fields, Items & Sets > Calculated Items

STEP 4: Click on calculated items

Figure 4.4: Calculated Items (Product Description) window


Data Analysis With Excel Pivot Table 34

STEP 5: In the Name box, you can give your fields a name “Laptop Bag Sold”.
In this step, we are going to create a simple calculation that sum all the items related to Laptop
Bag.

STEP 6: Select the item one by one and separate them with + sign.
STEP 7: Click ADD
STEP 8: Click OK

Figure 4.5: Calculated Items results after click OK

To hide any items, you can deselect the options you want to hide.

Figure 4.6: Hide the two original laptop bag items


Data Analysis With Excel Pivot Table 35

Result:

Figure 4.7: The end result


Data Analysis With Excel Pivot Table 36

4.2 Summarizing Values


You can summarize a PivotTable by placing a field in Σ VALUES area in the PivotTable Fields
Task pane. By default, Excel takes the summarization as sum of the values of the field in Σ
VALUES area. However, you have other calculation types, such as, count, average, max, min
and etc.

4.2.1 SUM
Consider the following PivotTable wherein you have the summarized sales data region wise,
salesperson-wise and month-wise

Figure 4.8: Summarizing Elements in Pivot Table

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.
Data Analysis With Excel Pivot Table 37

4.2.2 Value Field Settings


With Values Field Settings, you can set the calculation type in your PivotTable. You can also
decide on how you want to display your values.

STEP 1: Click on Sum of Order Amount in ∑ VALUES area.


STEP 2: Select Value Field Settings from the dropdown list.

The Value Field Settings dialog box appears.


The Source Name is the field and Custom Name is Sum of field. Calculation Type is Sum.

Figure 4.9: Value Field Settings > Show Values As - No Calculation

STEP 3: In the box Show Values As, No Calculation is displayed.


STEP 4: Click the Show Values As box. You can find several ways of showing your total values.
Data Analysis With Excel Pivot Table 38

4.2.3 % of Grand Total


You can show the values in the PivotTable as % of Grand Total.

STEP 1: In the Custom Name box, type % of


Grand Total.
STEP 2: Click on the Show Values As box.
STEP 3: Click on % of Grand Total in the
dropdown list. Click OK.

Figure 4.10: Value Field Settings > Show Values As -


% of Grand Total

The PivotTable summarizes the values as % of the Grand Total.

As you can observe, Sum of Order Amount in the top-left corner of the PivotTable and in the
∑ VALUES area in the PivotTable Fields pane is changed to the new Custom Name - % of
Grand Total.

Figure 4.11: Values as % of the Grand Total


Data Analysis With Excel Pivot Table 39

STEP 4: Click on the header of the Grand Total column.


STEP 5: Type % of Grand Total in the formula bar. Both the Column and Row headers will change
to % of Grand Total.

Figure 4.12: The "% of Grand Total" appear on the column label.
Data Analysis With Excel Pivot Table 40

4.2.4 % of Column Total


Suppose you want to summarize the values as % of each month total.

STEP 1: Click on Sum of Order Amount in ∑


VALUES area.
STEP 2: Select Value Field Settings from the
dropdown list. The Value Field Settings
dialog box appears.
STEP 3: In the Custom Name box, type % of
Month Total.
STEP 4: Click on the Show values as box.
STEP 5: Select % of Column Total from the
dropdown list.
STEP 6: Click OK. Figure 4.13: Value Field Setting > Show values as - %
of Column Total

4.2.5 % of Row Total


You can summarize the values as % of region totals and % of salesperson totals, by selecting %
of Row Total in Show Values As box in the Value Field Settings dialog box.

You can summarize the


values as % of region
totals and % of
salesperson totals, by
selecting % of Row Total
in Show Values As box in
the Value Field Settings
dialog box.

Figure 4.14: The "% of Row Total" appear on the column label.
Data Analysis With Excel Pivot Table 41

4.2.6 Count
Suppose you want to summarize the values by the number of Accounts region wise,
salesperson wise and month wise.

STEP 1: Deselect Order Amount.


STEP 2: Drag Account to ∑ VALUES
area. The Sum of Account will be
displayed in the ∑ VALUES area.
STEP 3: Click on Sum of Account.
STEP 4: Select Value Field Settings from
the dropdown list. The Value Field
Settings dialog box appears.
STEP 5: In the Summarize value field by
box, select Count. The Custom Name
changes to Count of Account.
STEP 6: Click OK.
Figure 4.15: Value Field Setting - Summarize Values By -
Count

The Count of Account will be displayed as shown below –

Figure 4.16: Count of Account appear in the field label


Data Analysis With Excel Pivot Table 42

4.2.7 Average
Suppose you want to summarize the PivotTable by average values of Order Amount region
wise, salesperson wise and month wise.

STEP 1: Deselect Account.


STEP 2: Drag Order Amount to ∑ VALUES
area. The Sum of Order Amount will be
displayed in the ∑ VALUES area.
STEP 3: Click on Sum of Order Amount.
STEP 4: Click on Value Field Settings in the
dropdown list. The Value Field Settings
dialog box appears.
STEP 5: In the Summarize value field by box,
click on Average. The Custom Name
Figure 4.17: Value Field Setting - Summarize Values
changes to Average of Order Amount.
By - Average
STEP 6: Click OK.

The average will be displayed as shown below –

Figure 4.18: Show the result after apply summarizing value by average

You have to set the number format of the values in the PivotTable to make it more presentable.

STEP 7: Click on Average of Order Amount in ∑ VALUES area.


STEP 8: Click on Value Field Settings in the dropdown list. The Value Field Settings dialog box
appears.
Data Analysis With Excel Pivot Table 43

STEP 9: Click on the Number Format button.

Figure 4.19: Value Field Setting on Number Format

The Format Cells dialog box appears.

STEP 10: Click on Number under Category.

Figure 4.20: Format Cells to set the Number category to 2 decimal places
Data Analysis With Excel Pivot Table 44

STEP 11: Type 2 in the Decimal places box and click OK.
The PivotTable values will be formatted to numbers with two decimal places.

Figure 4.20: Result after summarize the values by using Average with two decimal places

STEP 12: Click on the header of the Grand Total column.


STEP 13: Type Average Order Amount in the formula bar. Both the Column and Row headers
will change to Average Order Amount.
Data Analysis With Excel Pivot Table 45

4.2.8 Max
Suppose you want to summarize the PivotTable by the maximum values of Order Amount
region-wise, salesperson-wise and month-wise.

STEP 1: Click on Sum of Order


Amount.
STEP 2: Select Value Field Settings
from the dropdown list. The Value
Field Settings dialog box appears.
STEP 3: In the Summarize value field
by box, click Max. The Custom
Name changes to Max of Order
Amount.

Figure 4.21: Value Field Setting - Summarize Values By -


Average

The PivotTable will display the maximum values region wise, salesperson wise and month
wise.
STEP 4: Click on the header the Grand Total column.
STEP 5: Type Max Order Amount in the formula bar. Both the Column and Row headers will
change to Max Order Amount.

Figure 4.22: Result after do summarizing values by using Max function


Data Analysis With Excel Pivot Table 46

4.2.9 Min
Suppose you want to summarize the PivotTable by the minimum values of Order Amount region
wise, salesperson wise and month wise.

STEP 1: Click on Sum of Order Amount.


STEP 2: Click on Value Field Settings in the
dropdown list. The Value Field Settings
dialog box appears.
STEP 3: In the Summarize value field by box,
click Min. The Custom Name changes to
Min of Order Amount.
The PivotTable will display the minimum
values region wise, salesperson wise and
month wise.

Figure 4.23: Value Field Setting > Summarize Values


By - Min

STEP 4: Click on the header of the Grand Total column.


STEP 5: Type Min Order Amount in the formula bar. Both the Column and Row headers will
change to Min Order Amount.

Figure 4.24: Result after do summarizing values by using Min function


Data Analysis With Excel Pivot Table 47

4.3 Applying Custom Calculations


Excel pivot tables provide a feature called Custom Calculations. Custom Calculations enable
you to add many semi-standard calculations to a pivot table. By using Custom Calculations,
for example, you can calculate the difference between two pivot table cells, percentages,
and percentage differences.

This pivot table shows coffee product sales by month for the imaginary business that you own
and operate. Suppose, however, that you want to add a calculated value to this pivot table
that shows the difference between two months' sales. You may do this so that you easily see
large changes between two months' sales. Perhaps this data can help you identify new
problems or important opportunities.

4.3.1 How to apply custom calculation in your Pivot Table?


STEP 1: Open your Pivot Table data.
Sum of Qty Column Labels
Row Labels Apple Banana Beans Broccoli Carrots Mango Orange Grand Total
Australia 20634 52721 14433 17953 8106 9186 8680 131713
Canada 24867 33775 12407 3767 19929 94745
France 80193 36034 680 5341 9104 7388 2256 140996
Germany 9082 39686 29905 37197 21636 8775 8887 155168
New Zeland 10332 40050 4690 1210 56282
United Kingdom 17564 42908 41815 38436 41815 5600 21744 209882
United States 28615 95061 56284 26715 56284 22363 30932 316254
Grand Total 191287 340235 143117 142739 136945 57079 93638 1105040
Figure 4.25: Sample of PivotTable

STEP 2: Put your cursor anywhere inside the PivotTable field to activate it.

Figure 4.26 PivotTable activated


Data Analysis With Excel Pivot Table 48

STEP 3: Identify the custom filed that you need.

Figure 4.27: Identify the custom fields required in the calculation

STEP 4: Go to Analyse tab

Figure 4.28: Analyze > Fields, Items & Sets > Calculated Field

STEP 5: In the calculation area, click Fields, Items & Sets and select Calculated Fields.
Data Analysis With Excel Pivot Table 49

STEP 6: The Insert Calculated Field windows will pop-up. In the name box, type “Tax”.

Field Name

Custom
Formula

Figure 4.29: Showing the custom formula

STEP 7: In the Formula box, type in your tax formula. For example, “=IF (Qty > 100000, 3%* Qty,
0)”.
STEP 8: Click Add.

New Fields for


custom calculation

Figure 4.30: New Fields of custom calculation - Tax


Data Analysis With Excel Pivot Table 50

STEP 9: Click OK.

Figure 4.31: The new fields (Tax) appear in Pivot table (new column) and also appear in PivotTable Fields
box
Data Analysis With Excel Pivot Table 51

- CHAPTER 5 -
EXERCISES

5.1 Tutorial 1: Converting Source Data For A PivotTable


Account Marketing Operations Corporate

Office Supplies 689 787 629

Postage 1080 817 653

Telephone 170 1011 765

Trade Shows 594 894 386

Travel 1058 492 1013

Table 5.1: Original or Source Data

Answers:

Figure 5.1: The Unpivot Result


Data Analysis With Excel Pivot Table 52

5.2 Tutorial 2: Creating A Pivot Table

Figure 5.2: PivotTable Result


Data Analysis With Excel Pivot Table 53

5.3 Tutorial 3: Creating Multiple Types of PivotTable Information


Download “Sample Data – Data File.xlsx”.
Create a PivotTable that will show the following information:
1. Sales by Categories & Chain
2. Sales by Managers from different states & Chain
3. Sales by Chain (Months & Years)

Note: Name your sheets follow the above three PivotTable information and set the Format
Number to 2 decimal and use 1000 separator (,)

Answers:
1. Sales by Categories & Chain
Data Analysis With Excel Pivot Table 54

2. Sales by Managers from different states & Chain

Figure 5.4: Sales by Managers from different states & Chain


Data Analysis With Excel Pivot Table 55

3. Sales by Chain (Months & Years)

Figure 5.5: Sales by Chain Follow by Months & Years


Data Analysis With Excel Pivot Table 56

5.4 Tutorial 4: Creating PivotTable Charts


Based on your answers in Tutorial 3, create a PivotTable Charts:

1. Bar PivotChart
- Display Sales by Categories Chain & Sales by Managers Chain from different
states
2. Line PivotChart for displaying
- Display Sales by Chain follow by months & years

Answers:
Data Analysis With Excel Pivot Table 57

5.5 Tutorial 5: Creating Simple Dashboard


Based on your answers in Tutorial 4, combine all the PivotChart and create a simple
Dashboard.

Task:
• Remove the filter button on each chart
• Element: Add a PivotTable Slicers
• New PivotTable Charts:
1. Pie PivotTable Charts to display only the “Sales of Chain”.
2. Sparkline Pivot to display “All Chains Sales Total and Trend by State”
3. Map Charts to display the “Sales follow by the Country State”
• Add graphic

Answer:

You might also like