Vous êtes sur la page 1sur 21

Excel Pivot Tables

Page 1 of 21

Excel Pivot Tables


Course Prerequisites .............................................................................................................................................. 3

Part 1.1: Introducing Pivot Tables and Pivot Charts ............................................................................... 4


Exercise: ................................................................................................................................................................ 4

P1.2 Setting up and Formatting Pivot Table Data Fields .......................................................................... 5


Exercise: ................................................................................................................................................................ 5

P1.3 Creating a Pivot Table ...................................................................................................................... 7


Exercise ................................................................................................................................................................. 7

P1.4 The Pivot Table Toolbar .................................................................................................................... 7


P1.5 The Structure of a Pivot Table .......................................................................................................... 8
P1.6 Add Data Items ................................................................................................................................. 8
Exercise: ................................................................................................................................................................ 8

P1.7 Format Values ................................................................................................................................... 9


Exercise: ................................................................................................................................................................ 9

P1.8 Data Items Field Settings ............................................................................................................... 9


Exercise: ................................................................................................................................................................ 9

P1.9 Setting up Pivot Table Categories - Rows ...................................................................................... 10


P1.10 Setting up Pivot Table Categories - Columns ............................................................................... 10
P1.11 Drag Field Name to Switch Layout ............................................................................................... 10
Exercise: .............................................................................................................................................................. 10

P1.12 Setting up Sub-categories............................................................................................................. 11


Exercise: .............................................................................................................................................................. 11

P1.13 Reformatting on the Fly ................................................................................................................. 11


Exercise: .............................................................................................................................................................. 11

P1.14 Choosing the Best Layout ............................................................................................................. 12


Exercise: .............................................................................................................................................................. 12

P1.15 Removing a Field .......................................................................................................................... 12


Exercise: .............................................................................................................................................................. 12

Part 2: Common Mistakes ........................................................................................................................ 12


P2.1 Miss Placing Data Items ................................................................................................................. 13
Exercise: .............................................................................................................................................................. 13
Exercise: .............................................................................................................................................................. 13

P2.2 Missing PivotTable Field List .......................................................................................................... 14


P2.3 Missing PivotTable Toolbar ............................................................................................................. 14
Exercise: .............................................................................................................................................................. 14

Part 3: Understanding Your Data ............................................................................................................ 15


Exercise: .............................................................................................................................................................. 15

P3.1 Review Your Data & Column Headings .......................................................................................... 16


Part 4: Understanding the Relationship between Pivot Charts and Tables....................................... 16
P4.1 Creating Pivot Charts ...................................................................................................................... 16
Exercise: .............................................................................................................................................................. 16

P4.2 PivotChart Filter Pane ..................................................................................................................... 17


P4.3 Adding Fields to your PivotChart .................................................................................................... 17
Exercise: .............................................................................................................................................................. 17

P4.4 Removing Fields from your PivotChart ........................................................................................... 18


P4.5 Printing Your PivotChart ................................................................................................................. 18
Exercise: .............................................................................................................................................................. 18

P4.6 Sorting Your Data in Ascending or Descending Order ................................................................... 19


Exercise: .............................................................................................................................................................. 19

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 2 of 21

Part 5: What do I need to Know About PivotTables? ............................................................................ 19


P5.1 Refreshing Your Data ..................................................................................................................... 19
Review the Relationship Again:............................................................................................................................ 19

P5.2 Limited by Available Memory .......................................................................................................... 20


P5.2 Suggested Fixes .......................................................................................................................................... 20

P5.3 Limited by the Version of Excel you are Running ........................................................................... 20


P5.3 Suggested Fixes .......................................................................................................................................... 20

P5.4 The 3 Golden Rules ........................................................................................................................ 21


P5.5 Try it! ............................................................................................................................................... 21
Exercise: ................................................................................................................ Error! Bookmark not defined.
Exercise: .............................................................................................................................................................. 21
Exercise: .............................................................................................................................................................. 21

P5.6 Analyzing Data: ............................................................................................................................... 21


Exercise: .............................................................................................................................................................. 21
Exercise: .............................................................................................................................................................. 21

Post Assessment Questionnaire .......................................................................................................... 21

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 3 of 21

Excel Pivot Tables


This advanced workshop focuses on working with pivot tables. Pivot table reports help organize and
compare data so you can see patterns, trends and relationships. The desired prerequisite for this
workshop is intermediate-level knowledge of Excel. We will be working on Windows computers during this
workshop.

Course Prerequisites

Insert Function dialog box for functions such as, sum, min, max and average
Sort, filter and subtotal categorized data
Add and delete worksheets in Excel workbooks
Import and export data to and from Excel
Format data such as currency and dates in worksheet rows and columns
Work with worksheet formulas
Format charts

An electronic version of the handout material is provided for you on the course CD. These materials may
be used with your staff for professional development as long as the original copyright remains in place.
The Pivot tables and charts feature in Excel lets educators begin disaggregating and analyzing data
within seconds of receiving original data files from state departments, testing companies, and/or school
districts and/or classroom records.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 4 of 21

Part 1.1: Introducing Pivot Tables


and Pivot Charts
Pivot tables and charts are a powerful feature in
Excel that allows you to analyze your data with just a
few mouse clicks. With pivot tables you can reformat
your data easily by spinning (pivoting) the data axis,
or filtering content without affecting the underlying
data.
The image on the right shows an example of a pivot
table that has some simple color formatting applied
to help break up the various areas.
There are two main areas in a pivot table:
1. The data items section which is the table
itself.
2. The page items section which is an optional
section that adds additional filtering options.

Exercise: Open the Example_Data_01.xls, click on


the (P1.1) file to see another example of a pivot
table. Take a few minutes to familiarize yourself with
a pivot table and how they work before we begin
building one.
Case Study:
This pivot table looks at how students are
progressing in language arts for the month of
September.
Task 1: We want to look at how the 5 students who
are receiving extra tutoring help are doing. To make
it easier to review the data, click on the "Student
filter in cell a5, notice that all of the students have a
check box next to their name, which means that the
data for each student is showing in our report.
To deselect all of the names, uncheck the top box
"Select All, and then select 5 students by placing a
check in the box next to their name.
Next: When you have taken a look at the 5 students
that received extra tutoring help click on the
"Student" filter in cell a5 and "Select All" to display all
of the student data again.
Task 2: Now we want to take at the only the
students who are in Ms. Smith's class. Notice that
page items have a field label in column "A" and a
display box in column "B" that identifies what content
is currently displayed. By default page items are set
to display "All".
Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 5 of 21

Click on the "Teacher" filter in cell a2, and select a


teacher. You may also want to take a look at how
students are doing by race by changing the filter in
cell b1. When you are done return the filter to "All".
Note: You may have noticed that there are a few
issues with the fields, filter options, and the data that
is available in this pivot table. We will be covering
those issues in the next section (P1.2).

P1.2 Setting up and Formatting Pivot


Table Data Fields
Many of the data layouts that are used in
spreadsheets for presentations are not appropriate
when used as the source data for a pivot table
report. Here are some important guidelines for
preparing and using data as a source for
PivotTables.

Source data or raw data, should be in a list


format (tabular layout), and must have
column headings. The labels in the first row
of your data should describe the information
in each column. Your pivot table cannot be
created without the column headings. Each
column heading should be unique, so that
you can identify the column in the list of
available fields.
The column headings should be in one cell
and should not be stacked in multiple rows
Delete any empty blank columns or rows in
your data source.
Fill-in any empty cells with some logical
missing-value wherever possible.
Avoid storing data in section headings
Avoid repeating groups as columns
Apply appropriate type formatting to your
fields.

Example_data_01.xls contains the source data for the first


part of this lesson, however if we look at the guidelines for
setting up our source data you will see that we have some
problem areas. It is possible to create PivotTables from this
data, although it will not be ideal. As you work through the
samples, think about how you could alter the data source so
that is more functional.

Exercise: Open Example_data_01.xls, click on the


(PivotTable_1.2) worksheet. Click in cell A3 to
activate the pivot table and to bring up the field list.
Scroll through the field list; notice there are duplicate
field names which will make it difficult to work with
your data accurately.
Then click on the next worksheet (Data_1.3). Review
the recommendations above and make the
necessary changes to your source data. Save your
changes.
Instructions: For the purpose of this workshop we
are only going to apply the changes to the
September and October Data. If you were using this
spread sheet as your source data you would need to
go in and make changes to all of the months.
Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 6 of 21

1. In row 3 - change the 3 letter month to


"September - 5 questions in each skill area
with a maximum of 35 pts." Do the same for
"October - 5 questions....."
Change the column headings for:
2. From Race/Ethnicity to Ethnicity
3. From Focus (out of 5) to Focus Sep (etc..) For September and October Only
4. From Focus % (out of 5) to Focus % Sep
(etc...) - For September and October Only
5. Fill in all empty values with zero (0). Be sure
not to delete any formulas in the total
column.
Note: This is one of those areas that you want to be
careful of. Students who do not take the test are
different from students who take the take but do not
have a score of 1 or higher. When averaging your
data this will make a difference. You should add an
area for notes, so that you can make audit note
stating the number of students, along with the reason
why should they did not receive a score. I.e. Mark
had the flu and was excused from this in-class
assignment. You would not want to delete these
students from your data set, unless they did not
receive a score at any point in the year.
6. When you are done working with your
source data, return to the (PivotTable_1.2)
worksheet. Find the refresh icon on the
PivotTable toolbar to update the data that is
available for your PivotTable.
(

Refresh Icon)
7. Scroll through the field list once again, if you
have renamed the column headings you
should see your changes in the field list.
a. Do the new column headings help
you to identify the data that is stored
in each column?
b. Do you still have cells with the
following data error (#DIV/0!)?

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 7 of 21

P1.3 Creating a Pivot Table


Once you have your data prepared. You are ready to
create your PivotTable.

Exercise: In the same Excel file


Example_Data_01.xls click on worksheet (Data_1.3).
1. To begin put your cursor anywhere within the
data, on the text menu select Data (v2007:
Insert),
2. then choose, PivotTable and PivotChart
Report
3. The PivotTable Wizard will open, to help you
select your data, for now accept the defaults
for step 1 and click the Finish button.
4. A new worksheet with a blank PivotTable will
be created and is ready for you to begin
building your pivot table.
5. Double click on the new worksheet tab and
rename it to: (blank_1.4)
6. Click in cell A3 (anywhere within your table)
to bring up the PivotTable Toolbar
Note: If you are working with Excel version 2007 you
will have to select your data then click the OK button.
We will only be using the September and October
data for this exercise. The Range for the data is:
($A$4:$AI$106 )

P1.4 The Pivot Table Toolbar


Once your PivotTable is active the PivotTable toolbar
will appear giving you access to the tools you need
to work with your PivotTable and Pivot Charts. If your
toolbar is not visible click anywhere within your table.
Toolbar Icons: (Excel version 2003)
1. PivotTable Menu Contains additional
command such as, Group and Show Detail
and Sort and Top 10
2. Format Report change the visual format
3. Chart Wizard
4. Hide Detail
5. Show Detail
6. Refresh Data
7. Include Hidden Items in Totals
8. Always Display Items
9. Field Settings
10. Show Field List
Toolbar Icons: (Excel version 2007)
Are all labeled, and contain additional information on
how to use each icon, along with a link to a help
document. Even thought things look really different
you will see all of the same options.

Excel version 2003 & prior

Excel version 2003

Excel version 2007

Excel version 2007 - Close-up

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 8 of 21

P1.5 The Structure of a Pivot Table


You should still have worksheet (blank_1.4) open
with a blank pivot table. If your table is not active,
click in cell A3 (or any cell within the table) to activate
the table and view the sections of the PivotTable.
Orange: Aggregate Data:
The center is where you would put your aggregate
data item(s). Lets say for example math scores that
represent the overall aggregate of your classroom,
school, or district.
Blue: Categories: Row or Column Items:
Then you would decide how you want to sort and
view your data by dragging a field into the row or
column area. Say you want to break up your data by
year, district, school, instructor, benchmarks, or
gender.
Green: Filters: Page Items:
The page items section at the top of the table, allow
you to filter and sort the data further to determine
how much of the data is reviewed.

P1.6 Add Data Items


You should still have worksheet (blank_1.4) open
with a blank pivot table.
Clicking anywhere within the table should bring up
the Field list panel, unless you have previously
clicked on the X (close icon) for the panel. If the Field
list panel does not open when you click within your
pivot table, use the Field List icon on the Pivot Table
toolbar.
The Field list will display a list of the available fields
(column headings) in your source data. The list may
be docked on the right-hand side of your screen or it
may be floating.

Note: The default calculation is different depending on the


type of data you are using.

To begin building your PivotTable you will need to


decide which value you want to work with and what
questions you want to ask of your data.

Exercise:
1. Click and drag the field name, we will use
the field Focus for September into the
Drop Data Items Here area of the pivot
table.
2. Your screen will change to display a column
header and a single row of aggregated data.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 9 of 21

P1.7 Format Values


The first golden rule is to begin by formatting the
calculation type for the first data item before you
continue, whether it is sum, average, count or a
customized formula.

Exercise:
For this exercise you will return to the blank
PivotTable worksheet (PivotTable_1.2). This
PivotTable is using Data_1.3, which is the data that
you prepared in P1.2.
1. Click in cell A3 (any cell within your table) to
activate the PivotTable and bring up the
Field list Panel.
2. Click on the field named Focus (out of 5) for
September (it will vary depending on how
you named it) and drop it in the large area
for Data Items.

The heading will change to display the calculation type and


field name.

Note: If you have additional data items you will have


to go in and adjust the calculation type for each item,
however it will pick up the formatting from the first
item. If you dont follow the first golden rule, you will
have to set the formatting for each additional item.

P1.8 Data Items Field Settings


Exercise:
1. The calculation type may default to count
(see cell a3). To change the calculation type,
click in cell b4, and select Field Settings
from the PivotTable toolbar, or from the short
cut menu and select average.
2. Click on the Number Format button to
rename the field if needed, set the field type
to Number and set the decimal place to
zero.
3. The field bar will change to display the type
of calculation and the field name.
4. Click ok, to accept the changes, and cancel
to close the window without making any
changes.
Note: If your data is a number, but the cell is
formatted for general or text the field value will
always default to count. In some cases it may be
more productive to go back to your source data and
change the cell format to number. However
PivotTables can be a little quirky at times, and may
not pick up the data type from the source, in which
case you will have to determine the field type within
the PivotTable.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 10 of 21

P1.9 Setting up Pivot Table Categories Rows


Once you have added your first data item, you can
start dragging categories into the row or column
items area, to disaggregate that data. Review your
field list to see what categories are available in your
data set.
In the data set that we are working with, we can
select from student, teacher, or race/ethnicity.
As you drag data into your table you will notice that
the sections are highlighted when they become
active (top image). When you release your mouse
the data will be added to the selected area (bottom
image).

P1.10 Setting up Pivot Table Categories Columns


In this image we see the same data viewed in a
column format.

P1.11 Drag Field Name to Switch Layout


You can switch the field from row-to-column and
column-to-row until you decide which layout makes
visual sense to you.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click and drag the Teacher field adding it
into the row data area. (see image p1.9)
3. Now click on the field bar/header which is in
cell a4 and drag it to the column data area.
(see image p1.10)
4. Now click and drag the field bar/header
which is now in cell b3 and drag it back to
the row data area.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 11 of 21

P1.12 Setting up Sub-categories


To add a sub-category, click and drag in another
field, lets say Race / Ethnicity, as you move the
mouse cursor to the edge of the existing field the
divider will become highlighted. You can place the
new field to the left or to the right of the existing field.
In the example we have placed the sub-category
field to the right of the Teacher field.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click and drag the Ethnicity field adding it
into the row data area to the right of the
Teacher field. (see image p1.12)

P1.13 Reformatting on the Fly


At any given time you can reformat the data by
dragging a field into another position. You dont need
to do any sorting or change any formulas; Excel is
doing all of the work for you on the fly.
In the example we have moved the sub-category
field from a row data item to a column data item.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click and drag the Ethnicity field adding it
into the column data area. (see image p1.13)

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 12 of 21

P1.14 Choosing the Best Layout


Here we see the Race / Ethnicity sub-category to
the left of the Teacher field. Making it quick and
easy for you to select the layout that displays your
data the best.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click and drag the Ethnicity field adding it
into the row data area. This time to the left of
the Teacher field. (see image p1.14)

P1.15 Removing a Field


Click and drag the field away from the PivotTable
until the cursor displays a red X. Once you see the
red X release the mouse button and the field will be
removed from the pivot table.
The field is still available in the field list, and all of
your data is still intact.
Excel version 2007: You can also uncheck the field
box in the field list to remove an item.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. This time, click and drag the Ethnicity field
outside of the table area until you see your
cursor change to a gray bar with a red X,
then release your mouse to delete the field
from the table. (see image p1.15)

Part 2: Common Mistakes


Lets address a couple of common problems that
arise when you are working with pivot tables.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 13 of 21

P2.1 Miss Placing Data Items


The first common mistake is to drop the category
field into the data area, instead of the row or column
area. When this happens you end up with two data
values, and you wont see a field bar to grab and
drag the field (Teacher) into another area.
To move the field:
v2003: Click the Data drop down menu ( ), and
uncheck the field you want to delete.
v2007: Uncheck the field you want to remove from
the field list.

Exercise:
We are going to continue building our PivotTable
using worksheet (PivotTable_1.2).
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click and drag the Teacher field adding it to
cell b4 the Data Items area (see image
p1.15).
3. If you are using v2003 or prior you should
now see a filter menu on the column labeled
Data. Uncheck the Teacher field.
4. If you are using v2007 uncheck the field
you want to remove from the field list, or drag
the field into the row data area in the field list
panel.
5. Click and drag the Teacher field into cell
a4, and notice that the same thing occurs,
except the data is represented in rows.
6. Again remove the Teacher field from the
data items area. (see # 3 or 4 depending on
your version)
7. Click and drag the Teacher field into the
row items area. Your table should now be
back to its original state. (see image P1.9)

Exercise:
1. Repeat the step you took earlier when you
misplaced fields in the Data Items area.
Click and drag the other skill areas
a. content,
b. organization,
c. mechanics,
d. Imagery, and
e. style for September into the Data
Items. Adding each to the right of
the existing field(s). (see image
p2.2).
2. Click and drag in the Total field for
September into the Data Items, to the right
of the existing fields.
Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 14 of 21

P2.2 Missing PivotTable Field List


The field list is only visible when the pivot table is
active. Meaning that you are working within the table.
If you have click on a cell within your pivot table and
do not see the field list floating or docked on the
right-side of your screen, you may have closed the
panel using the close icon (X).

Excel version 2003

1. To bring up the Field List panel again, click


on the Field List icon on the PivotTable
toolbar.

P2.3 Missing PivotTable Toolbar


The toolbar can be turned on or off in all versions of
Excel prior to Excel 2007. If your toolbar does not
appear when you click within your pivot table you can
turn it on manually by:
1. by selecting view on the text menu,
2. click on toolbars
3. and place a checkmark before the toolbar
you want to turn on, in this case
PivotTables

Excel version prior to 2003

Excel version 2003

Excel version 2007

The PivotTable toolbar is a smart feature, which


means that it will automatically appear when the
pivot table is active. The toolbar maybe docked on a
layer of icon toolbars, or may be floating somewhere
on your screen, depending on how you like to work.
If you move your toolbar, Excel will reopen it in the
same position.
When your toolbars is floating on your screen, it will
have a title bar (see excel version prior to 2003).
Click and drag the title bar to move the toolbar. Click
the X icon to close the toolbar.

Exercise:
When your toolbar is docked, it will have a handle at
the beginning of the toolbar (see Excel version 2007)
that looks like a line of vertical dots.
1. Click and drag the toolbar handle to move it
into another area of your screen.
2. To float a toolbar, pull it towards the center
of the page.
3. Click and drag the title bar, and push it into
the right side of your screen to dock.
4. You can also dock the toolbar on the bottom,
or the left side of your screen.
5. Replace the toolbar in an area that is easy
for you to work with and that has enough
room to display all of the icons on the
toolbar.

Excel version 2007 - Close-up


In Excel 2007 the toolbar feature cannot be turned on or
off, however two new options will appear on your text
menu, with the word PivotTable Tools above them,
when you click in any cell within your table.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 15 of 21

Part 3: Understanding Your Data


The second golden rule and the key to using
PivotTables is that you need to know your data and
its suitability for a pivot table.
Top Image: For example you will receive an error
#DIV/0! If you try to run an Average calculation on a
field that contains text, such as labels or improperly
formatted data, instead of a field that contains
numerical data.
Bottom Image: A text field dropped into the data
items section will sometimes default to count and
provide you with the total number of samples that are
non-blank records. This is handy if you want to run
a non-mathematical function on the data like,
compiling a count of the number of students who
received an A, B, C, D, F or INC, or how many
students were in each course.
At the beginning of the workshop in P1.2 Setting up
and Formatting PivotTable Data Fields we prepared
our data by filling in all of the records that did not
have data with an appropriate value. In our case we
added zeros to the skill data. If take a count of the
number of students in our sample group, we would
get an accurate number because there are no blank
fields in our records.
If you did not prepare your source data, you would
have found that the count did not accurately reflect
your sample group.
For example you may have 160 records, but
if 58 are blank your total count will display
102.

Exercise:
1. Click on worksheet (PivotTable_1.2) which is
a new blank pivot table.
2. From the text menu select Move or Copy
3. Place a check in the checkbox to make a
copy of the worksheet.
4. Put the new worksheet before the
(Sort_Table) worksheet.
5. Double click on the worksheet tab, and name
it (P3).
6. Click and drag the Teacher field into the
row data area.
7. To find out how many students are enrolled
in each class, click and drag the Teacher
field (from the field list) and add it to the data
items. Note that the teacher field is a text
field and will default to count.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 16 of 21

P3.1 Review Your Data & Column


Headings
Look at your data and become familiar with the fields
that are available. Identify the fields (column
headings) that will make good category options and
those that will provide good value (data item)
options.
Sometimes you will have a field that appears to be a
numerical field, however the column format is set to
general or text. These columns should be converted
to numbers and the appropriate formatting should
be set as soon as the data is added to your pivot
table.
In our example database, all of the fields, even those
with numerical values were set to general and will
default to count if the column format is not changed
to numbers.

Part 4: Understanding the


Relationship between Pivot Charts
and Tables
The third golden rule is that PivotTables and
PivotCharts are linked together. You can work in the
table view or the chart view to break out your data
and the changes will be reflected in both views.
When you are working with the PivotChart you will
have access to all of the chart features and types
that are available in Excel.

P4.1 Creating Pivot Charts


You can create a pivot chart from an existing pivot
table with as little as one data item added to the
table.

Exercise: Create a Pivot Chart from your Pivot


Table:
1. Click anywhere within your pivot table and
then click on the Chart Wizard icon that is
on the PivotTable toolbar.
2. Select the type of chart Column Bar Chart
3. Select the location for your chart either on
the same worksheet or on a new worksheet.
You can always move your chart later by
selecting the Move Chart command on the
Chart toolbar. For this exercise create your
chart on the same worksheet.
4. Click OK

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 17 of 21

P4.2 PivotChart Filter Pane


In Excel version 2007 the fields are accessed from
the PivotChart Filter Pane. In all previous versions
of Excel the fields are accessed by drop down
menus that appear on the chart. Click and drag the
fields to move them, or use the fields drop down
menu to filter field data. Your charts are updated
immediately.
You can also filter the category fields that are
displayed on the axis.

P4.3 Adding Fields to your PivotChart


In Excel version 2003 you can click and drag fields
onto your chart, positioning them where you would
like them to appear.
Sub-Category: For example if you would like to add
a sub-category to your chart you would add the field
to the right of the existing field.
Primary Category: If you would like the new field to
be the primary category then you would add the new
field to the left of the existing field.
Page Fields: You can add additional sorting fields
by dragging a new field to the top of the chart, which
is the page field area.
In Excel version 2007 you will work primarily within
the field list panel. Below the check list of available
fields you will find the PivotTable areas. Drag and
drop the field into the correct area of the table.
Sub-Category: If you want to add a sub-category
you would drag the new field into the Axis Field area
below the existing field (Teacher).

Excel Version 2007

Primary Category: If you want your new category to


be the primary category you would drag the new field
into the Axis Field area above the existing field
(Teacher).
Page Fields: To add page fields to your drag and
drop the field into the Report Filter area. All page
fields will default to all.

Exercise:
We are going to continue building our PivotChart
using worksheet (P3).
1. Click in cell A3 to activate your table and bring
up the Field List.
2. Click and drag the Ethnicity field into the Page
Items area on the top of the chart.
3. On your pivot table or your pivot chart, filter the
Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 18 of 21

Ethnicity so that only the minorities are displayed


in the report.
4. Then take a look at only the Caucasians.
5. Perhaps it would be easier if you could see the
break down for both ethnicities at the same time
so that you can get a better idea of how each
group is doing in comparison to the other. To do
this drag the Ethnicity field down into the row
items area. Try placing the field on both the left
and the right.

P4.4 Removing Fields from your


PivotChart
Removing fields from your PivotChart works the
same as removing fields from the PivotTable. Click
and drag the field outside of the area, away from the
chart until the cursor displays a red X. Once you
see the red X release the mouse button and the
field will be removed from the pivot chart.
The field is still available in the field list, and all of
your data is still intact.
Excel version 2007: You can also uncheck the field
box in the field list to remove an item.

P4.5 Printing Your PivotChart


In Excel 2003 and earlier the field and field areas
show on the chart as a button. To turn these buttons
off prior to printing:

Exercise:
We are going to continue working with the PivotChart
on the (P3) worksheet.
1. Select the PivotChart drop down menu, on
the PivotChart toolbar
2. Choose Hide PivotChart Field Buttons
3. To access the buttons and make changes to
your pivot chart, select the PivotChart drop
down menu, on the PivotChart toolbar and
choose Show PivotChart Field Buttons
This step is not needed in Excel version 2007,
because the field and field areas are not visible on
the chart. You will work primarily within the Field
List panels.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 19 of 21

P4.6 Sorting Your Data in Ascending or


Descending Order
Exercise:
We are going to continue working with the PivotChart
on the (P3) worksheet.
1. Click in cell A3 to activate your table and
bring up the Field List.
2. Click in cell B5 and then click on the sort &
filter icon AZ to filter the data in ascending or
descending order. Notice that your chart is
automatically updated.

Part 5: What do I need to Know


About PivotTables?
As you might have guessed, it takes a computer with
a significant amount of memory to run a robust
process like PivotTables and PivotCharts. When you
initiate a PivotTable, Excel takes a snapshot of your
data and holds it in cache. The cache is a storage
area that is not visible in the file. The more data you
have the larger the file size will be. The cache
snapshot is what allows you to make rapid changes,
such as, rearranging fields, adding new fields, or
hiding items.

The examples in this tutorial, so far, have come from the


Example_Data_01.xls file which is 1.5 MB, and is
significantly larger than most Excel files which do not
have PivotTables or PivotCharts in them.

P5.1 Refreshing Your Data


Any changes you make to your original data source
will not be picked up by your pivot table report until
you take another snapshot of the data source, or
refresh the pivot cache.

Excel version prior to 2003


Excel version 2003

Review the Relationship Again:


The source data is NOT connected to the PivotTable
or the PivotChart. What you see in the PivotTable
and the PivotChart is based on a snapshot that is
frozen in time. If changes are made to the source
data, you MUST REFRESH the data, which takes a
new snapshot.
The PivotTable and the PivotChart ARE connected
and will reflect all changes that are made
automatically.

Excel version 2007

Excel version 2007 - Close-up

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 20 of 21

P5.2 Limited by Available Memory

P5.2 Suggested Fixes

Some of the limitations that you must be aware of are dependent on the amount
of memory your computer has available and others will depend on which
version of Excel you are running.

The first limitation which is


Limited by Available
Memory can be remedied by
adding more RAM to your
system, and making sure that
you have a minimum of 20%
free space on your hard drive.
If you are having problems
running an Excel spreadsheet
or if it is running slow, try
closing all other programs to
free up more of your system
resources.

P5.3 Limited by the Version of Excel you are Running

P5.3 Suggested Fixes


The second limitation which is
the Physical limitations of
Excel is based on the
version you are running. If
you find that you are working
with large, robust files and
need to add more items to
your PivotTables and
PivotCharts, the only
workaround may be to
upgrade your version of
Excel.
Be careful to check all of the
system requirements before
purchasing new software, to
be sure that your computer
can run the newer version.

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Excel Pivot Tables

Page 21 of 21

P5.4 The 3 Golden Rules

P5.5 Try it!


P5.6 Analyzing Data:
to build pivot tables and charts.

Can this data be used successfully to create Excel Pivot


Tables and Charts?

Exercise: Use the student_count_2004-06.xls file to

Exercise: Analyze the Star_Magnitude_Graphing.xls

see how summarized data can be used to create


pivot tables and charts to view the numbers of
students in grades K-12, or can be broken down to
view only elementary, middle or high school
students.

file to see if it can be used to create pivot tables and


charts.

Exercise: Use the 06-07 Enroll-official count.xls file

Exercise: Analyze the sat_2001_06.xls file to see if it


can be used to create pivot tables and charts.

Post Assessment Questionnaire

Copyright 2007, Hawaii Department of Education, Office of Curriculum, Instruction and Student Support, Advanced
Technology Research Branch. These materials may be used for non-commercial educational purposes only. Permission to
use this information is granted freely as long as this notice is kept with it.

Vous aimerez peut-être aussi