0% found this document useful (0 votes)
26 views18 pages

Adv-Excel - VBA-5 - Pivot Table - N

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views18 pages

Adv-Excel - VBA-5 - Pivot Table - N

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

ADVANCED EXCEL

Pivot Table
Using Pivot Tables to analyze data :

A Pivot table report is an interactive table that can be used to quickly


summaries, analyze and present large amounts of data by categories and
subcategories. You can rotate its rows and columns to see different
summaries of the source data, filter the data by displaying different
reports, or display the details for areas of interest. .

When to use a Pivot Table report :

You might want to use a Pivot Table report if you wish to compare
related totals, especially when you have a long list of figures to
summaries and you want to compare several facts about each figure.

Because a Pivot Table report is interactive, you can change the view of
the data to see more details or calculate different summaries
ADVANCED EXCEL

Pivot Table
Using Pivot Tables to analyze data (Cont’d) :

The data area is the part of the Pivot Table report that contains
summary data. The cells of the data area show summarized data for the
items in the row and column fields. Each value in the data area
represents a summary of data from the source records or rows.

Elements of a Pivot Table :


ADVANCED EXCEL

Pivot Table
Using Pivot Tables to analyze data (Cont’d) :

Pivot Table Element Definition

Row Fields Row fields are displayed on the side of the Pivot Table report;
rows can be nested within another row.

Column Field Column fields are displayed at the top of the Pivot Table report.
A Pivot Table report can have multiple column fields just as it
can have multiple row fields.

Data Item field and A data item field is a field from the data range or database
Summary functions that contains data to be summarized. The Pivot Table reports
use summary functions such as Sum, Count, and Average.
These functions also provide subtotals and grand totals
automatically, where you choose to show them.
Report Filter A Report Filter is a field that is assigned to a page or filter
orientation, it is used to filter the entire Pivot Table report when
you select an item from the drop-down list the Pivot Table
report displays the summarized data for only that item.

Items field drop- An item is a subcategory of a Pivot Table field. Items


down arrows represent unique entries in the same field or column in the
source data.
ADVANCED EXCEL

Pivot Table
Pivoting :

You can change the layout by dragging a field button to another part of
the Pivot Table report – e.g. move a column to a row or a row to a
column, you are transposing the vertical or horizontal orientation of the
field (this operation is called pivoting) you can view your data in different
ways and calculate different summarized values.
ADVANCED EXCEL

Pivot Table
Pivot Table Example:
The example we are going to use is simpler and part of it is shown below.

The table gives the number of pupils and staff in different types of
schools in a country district(name : schools.xls).
ADVANCED EXCEL

Pivot Table
Guidelines for creating a Pivot Table In Excel :

1. Excel automatically creates grand totals and subtotals in the Pivot


Table. If the source list contains automatic grand totals, remove them
before you create the Pivot Table.

2. Because Excel uses the data in the first row of a data range or table
for the Field names in the Pivot Table, the source data range MUST
contain column headings.

3. To make the pivot table easier to refresh and update when the source
list or database changes, you could name the source range and use
the named range when you create the Pivot Table.
ADVANCED EXCEL

Pivot Table
Example 1 – Number of Nursery Schools in SouthWest area:

Creating a Pivot Table :

Step1 : Open the File you want to use (schools.xls).

Step2 : Click on any cell in the table.

Step3 : Click on the Insert tab, in the Tables group, click on the
PivotTable button to display the Create PivotTable dialogue
box:

Step4 : Choose the data that you


want to analyze: Select a
table or range is the default.
ADVANCED EXCEL

Pivot Table

Creating a Pivot Table(Cont’d) :


Step5 : The Table/Range: is already selected for you. Excel will
automatically select the data range, as long as it recognizes your data
range or table.

Step6 : Under Choose where you want the PivotTable report to be


placed: are two options: you can insert the Pivot Table in a New
worksheet or Existing worksheet (the same worksheet as your table or
data range). We will put our Pivot Table on the same worksheet. This also
has the advantage that we can see them all and compares the results we
get.
ADVANCED EXCEL

Pivot Table

Creating a Pivot Table(Cont’d) :

Step7 : Select Existing worksheet, then click in the Location text box
and click on cell H5 in the current worksheet to specify where you
want to start the Pivot Table.
ADVANCED EXCEL

Pivot Table

Creating a Pivot Table(Cont’d) :

Step8 :Click on the OK button. This brings you back to the worksheet
which now has a blank Pivot Table and PivotTable Field List as shown
next: Field names from
the data range
Empty Pivot Table
because
no fields have
been selected yet

Drag fields into these


drop boxes to build a table
ADVANCED EXCEL

Pivot Table

Creating a Pivot Table(Cont’d) :

Step8(Cont’d) :
Field names from
the data range

Click on this button and select a style from


the drop-down list to change the layout of the
PivotTable Field List dialogue box

Drag fields into these


drop boxes to build a table
ADVANCED EXCEL

Pivot Table
At the same time, two additional, contextual tabs appear on the Ribbon
under the heading PivotTable Tools. There is an Options tab, which
should be selected, and a Design to change the appearance of the pivot
table.

● The field names in our original data range are shown in the floating
PivotTable Field List dialogue box.

● Let’s say we want to know ‘how many Nursery schools are there’.
Under Choose fields to add to report:

● Drag the required field – e.g. ‘Area’ from the list into the Column
Labels box. The column labels will be added to the pivot table.

● Drag the field ‘Type’ into the Row Labels box. Your pivot table and
field list should now look something like this.
ADVANCED EXCEL

Pivot Table
ADVANCED EXCEL

Pivot Table
The pivot table, by default, is created using the Compact Layout. At this
point, it is helpful to switch to Outline Layout, which shows the names
of the fields, instead of just saying Row Labels and Column Labels.

● Select the PivotTable Tools Design tab in the Ribbon. Select


Design.

In the Layout group, click on Report Layout, and choose Show in


Outline Layout. Your pivot table should now look like this:
ADVANCED EXCEL

Pivot Table
Drag the field ‘Name’ into the Values box. Name is the appropriate field
to use if we want to know the number of schools in the South -West
area. Excel will automatically use the Count summary function.

● The Pivot Table produced should look like this, and the top left cell will
be in H5 as requested.

If you click outside of the Pivot Table, the PivotTable changes its
appearance and the PivotTable Field List disappears, click on the Pivot
Table again and the PivotTable Field List appears and so do the two
PivotTable Tools tabs on the Ribbon.
ADVANCED EXCEL

Pivot Table

If the PivotTable Field List dialogue box does not appear, switch to the
Pivot Table Tools Options tab on the Ribbon and ensure that the Field
List button in the Show/Hide group is selected.
ADVANCED EXCEL

Pivot Table

The drop-down arrows next to Type and Area (shown next) produce the
following lists of selection boxes:

If you want to see just the Nursery schools in the South West area, deselect the
other options and the Pivot Table then looks like this:
ADVANCED EXCEL

Pivot Table

Excel automatically displays Subtotals and Grand Totals; you can show or hide
the Grand Totals by clicking on the Options tab and in the Pivot Table group
select Options to open the PivotTable Options dialogue box.

Click on the Totals & Filters tab and under Grand Totals; deselect Show grand
totals for rows or Show grand totals for columns and click OK.

You might also like