Excel Pivot Tables Manual
Excel Pivot Tables Manual
Excel
Pivot Tables
Introduction
This workbook has been prepared to help you create a PivotTable report – an interactive table that
automatically extracts, organises, and summarises your data. You can use this report to analyse the
data, make comparisons, detect patterns and relationships, and discover trends.
This guide can be used as a reference or tutorial document. To assist your learning, practical tasks
are Provided. In case if you require any help on these or any other matter you can easily refer your
query on [email protected].
PivotTable datasets
A good dataset for creating a PivotTable will
have data organised into columns with a heading
at the top of each column. There should be no
blank rows in the data so it is all organised into
one rectangular block. Each row is a record and
each column a field. In the data set on the right,
each row represents a stationery order placed by
a department.
Columns where the values are repeated within
the column are ideal for PivotTable row or
column labels. So for example, in the dataset on
the left, Dept, Term or Product might be
placed in the row or column headings. Amount
might be used as the Values to be summarised in
the centre of the PivotTable.
Example
If Dept is used as the row labels, each unique
value in that column will appear down the left-
hand side of the PivotTable. Similarly if Product
is used as the column labels then Paper and Toner
will appear across the top of the PivotTable.
Where a particular value in a row and a particular
value in a column intersect, the data in the
Amount field is summarised in the centre. By default the calculation used is Sum. So, for
Creating a PivotTable
1. Click anywhere within the range of data you wish to use to create your PivotTable.
2. From the Insert tab select PivotTable.
Excel will display the Create PivotTable dialog box, automatically select the entire
range and add the reference for that range to the Table/Range box.
3. Select New Worksheet or Existing Worksheet depending on where you want your PivotTable
to appear.
4. If you choose to put the
PivotTable into the existing
worksheet, you need to make sure
you tell the wizard where to place
it. The easiest way to do this is to
click into an area in the existing
spreadsheet. The cell reference
will appear in the Location box.
5. Click on the OK button.
A blank PivotTable and
PivotTable Field List will be
displayed. Two new PivotTable
Tools tabs become available on
the Ribbon: Options and Design.
Any column headings become
fields in the Field List.
Note that the Field List and additional Tabs on the Ribbon only appear when you click on the
PivotTable.
Arranging your data
1. From the Field List, drag the fields with the data you want to display in rows to the area on the
PivotTable diagram labeled Drop Row Fields Here or into the Row Labels box.
Example
In the example below, the data shows candidate exam results for specific modules (MODCODE),
the RESULT each candidate gained, their exact MARK, their grade (UCLGRADE) and the DATE
the exam was taken. The PivotTable shows the average MARK for each RESULT for each module
Formatting values
1. Display the Field Settings dialog box as shown
above.
2. Click on the Number Format button.
3. Select the Category you want and set any options.
For example, select Number and enter the number of
decimal places to display the data to.
4. Click OK and OK again and your cells will be
reformatted.
Helpful hint:
The Field Settings dialog box can be used to change the name of any Field in the PivotTable. For example,
this can be used to change the name of Dept to Department.
PivotTable Options
Pivot Table options control how data is displayed
1. Click on the Options button on the PivotTable Tools Options tab.
The PivotTable Options dialog box is displayed.
2. Useful options include:
For empty cells show (On the Layout and Format tab)
this enables you to display a default value (e.g. 0 or ‘No results’) where there is a blank.
Show grand totals for rows/columns (on the Totals and Filters tab)
Grand totals are displayed by default but can be removed if they are not meaningful. In the
example of percentages, above, the Grand Total for each column will always be 100% so it
is not meaningful and could be removed from the display.
Refresh data when opening the file (on the Data tab)
See Refreshing a PivotTable on page 10 for more details.
Grouping data
Data can be summarised into higher level categories by grouping items within PivotTable fields.
Depending on the data in the field there are three ways to group items:
Group selected items into custom categories.
Automatically group numeric items by a specific interval.
Automatically group dates and times by a specific interval.
Grouping selected items
1. Select the items you wish to group in a given row or column. Select adjacent
items by clicking and dragging, or non-adjacent items by selecting each item
whilst holding down the Ctrl key.
1. Click on the Group Selection button on the PivotTable Tools Options tab.
2. An additional column is created to the left (for row labels) or an additional row is created above
(for column labels) and a default name (e.g. Group1) is given to the group.
The name can be changed in the Custom Name box in Field Settings or in the Formula Bar.
Note that MODCODE2 is now another field in the Row Labels area and can be added or removed
like any other field.
Grouping numeric items into ranges
1. Select a single field item in the PivotTable.
2. Click on the Group Field button on the PivotTable Tools
Options tab.
3. Excel displays a dialog box in which it automatically enters a
start and end number based on the highest and lowest values in
your range. It also lists a number for the intervals to group by.
4. Select an appropriate interval and click OK.
Example
In the example below, marks are grouped in intervals of 10 so, for example, you can see that 1
candidate got between 40 and 49 marks in COMPB401 and 4 got between 50 and 59 marks.
In the example below, Top 10 on the Mark field is set to 5so it displays only the exam results
with the highest 5 values in the Grand total row i.e. the 5 exam results that appear most
frequently amongst candidates:
Refreshing a PivotTable
When data is changed in the PivotTable source list, the PivotTable does not automatically
recalculate. To refresh the table:
1. Select any part of the PivotTable.
1. On the Pivot Table Tools Options tab, click on the Refresh button.
Helpful hint:
PivotTable Options can be set to refresh data every time a spreadsheet is opened. See PivotTable
Options on page 5 for details.
Formatting PivotTables
Various options can be used to change the look of PivotTables. These can be found on the
PivotTable Tools Design tab. You can apply a PivotTable Style and choose whether or not to
have banded columns or rows (i.e. where rows or columns are coloured in alternate shades.