1. Excel Pivot Tables
Excel pivot tables make it easy to summarize a large data set into useful
categorical information.
By: Matthew Saragusa
polyhedron@gmail.com
2. What are pivot tables
A pivot table is a way to summarize data by grouping like
entries together and performing operations on them.
What does this mean? Let’s build up to that.
Let’s start with a basic data set, see the list to the right.
This set shows the sales for a specific month. January had three
sales, February had four sales, so on and so forth.
A pivot table will allow us to easily summarize the data on a
per-month basis, whether it’s the number of sales, average, or
total sales.
3. An example of this data in a pivot table
Here you will see that the data
has been grouped together
and operations have been
performed on the data.
For instance, in January, sales
were a total of 3 sales
averaged $45 per sale for a
grand total of $135 in sales.
4. So how was this done?
First, the data is selected. Simply drag and drop the cells
which you would want to reference.
After the data is selected, click the insert tab, and then pivot
table. This will bring up a dialog box asking if you want to
create a new worksheet, or place the table in a specific area.
For this exercise, leave the selections alone, as we want to
create a new worksheet.
You can just click OK.
5. Selecting Options
You will now see a dialog box, in the top of the box,
you will grab the field which you wish to display in
the row and drag to the “rows” box.
Then you will drag the values you wish to display
into the “values” box.
Here month is dragged into rows, and sale amount
is dragged into the values box 3 times. This is
necessary because we wish to display the count
frequency, average, and sum of each month.
6. So how do we show the average, sum, and
count?
Right click on one of the sale amounts
in the values box. Then click field
settings.
This will bring up a new dialog box
which will allow you to select one of a
number of operations which can be
done on grouped information. Here
we will select sum. Click OK. For the
next sale amount, right click, field
settings, and then choose count. This
will now display the count. Do this for
as many different operations as you
wish to do so.
8. But what if we had more data?
What if by each sale, we had a product that we
sold? Maybe we wanted to see how much revenue
per month was coming from each product?
You can also summarize by month in the rows, but
also separate by product by columns by dropping
the product into the columns box.
9. An example of multi-dimensional data in a
pivot table.
Here you will see a sum of
sales per month all the way to
the right, but in addition, for
each product listed in the
data column, a sum is also
provided for each product.
For example you will be able
to see that in August, $62
worth of ice cream was sold.
10. How do we show this columnar data?
Most steps are as shown before, but we will drag
the products into the column field.
This will create a column for every unique listing
in the data set. In this data set, there were 3
unique values, Candy, Ice Cream, and Lemonade.
11. So now this data is summarized by month and
product sold.
12. And even more dimensions are possible
We could use something called a slicer. This allows us to ”filter” the
data based off of selected values in the slicer.
13. How to create slices?
Click on the pivot table. At the top, select the analyze tab, and then
click Insert Slicer. This will bring up a dialog box. Here you would select
which field you prefer to slice from. In this case, we will select
Salesperson.
By doing this, we will create a ”switch” or filter to the data for the pivot
table. If we should click on Kay, only the data from the rows which have
Kay in the salesperson column will be displayed.
14. How to use the slicer.
Clicking one name will select the data for that name.
Holding control and clicking multiple names will allow
you to filter by multiple names. Clicking on a name, then
holding shift, and clicking on another on the list will
highlight both the initially clicked salesperson and the
last clicked salesperson, but all other salespeople in
between.
15. Things to know about pivot data
When the data is updated from the data set, the pivot table is not
automatically refreshed. When the data has changed, and you are
ready to update the pivot table summary, right click on the pivot table
itself and select refresh.
To edit a pivot table, click on it. Then a dialog box will pop up where
options can be changed in the pivot table.