pivot table
pivot table
1. INTRODUCTION
Pivot tables allow us to "slice and dice" data any way we want and
perform complex calculations. In this section we will use pivot tables to
effortlessly perform the following tasks:
You create a Pivot Table by placing your cursor within your data (the
first row of each column needs a heading or label) and then selecting
Pivot Table from the Insert tab. Then we "drag" the desired columns of
our choice to one of the following portions of the table:
Row Labels - If, for example, we drag Month to the row label, then we
will see (going down the table) a breakdown of a desired set of data by
Month.
Column Labels - If, for example, we drag Month to the Column labels,
then we will see (going across a row) a breakdown of a desired set of
data by month.
Values - If, for example, we drag Month to the Row Labels and Units to
the Values section, we will obtain the total revenue broken down by
month (listed vertically), because we put Month in the Row Labels
Section.
Report Filter - Dragging a column to the Report filter enables us to
display analysis for any subset of the possible values for the column.
For example, if we place Month in the Row Labels section, Product in
the Report Filter, and Units in the Values section, then we can select
any subset of products and display a breakdown by month of the total
units sold of any subset of products.
1
First, let's create a pivot table that shows the total dollar sales volume
of each product during each month. All we need to do is drag Dollars to
the Values section of the table, Month to the Row labels, and Product
to the Column labels.
CAPTION
Place the cursor anywhere inside our data. Now select Pivot table from
the Insert tab. Excel recognizes our data range. After clicking OK we
are ready to create our Pivot table. You will now see the PivotTable
Field dialog box. We first drag Month to the Row Labels section. This
will set us up to get a monthly breakdown of total sales dollars during
each month. Next we drag Product to the Column Labels section. This
will enable us to breakdown sales during each month by product.
Finally we drag Revenue to the Values section. We now see a
breakdown during each month of total revenues by product. For
example, in January we find that a total of $1190 of Caramel éclairs
was sold in January.
4. FORMAT VALUES
Note that the sales totals in our pivot table are not formatted in $s. We
will now show how to format the revenues in $s.
CAPTION
CAPTION
2
Right-click on the Sum of Revenue button and select Value Field
Settings. Then choose Average and select OK. You will now see the
average dollar size of transactions during each month involving each
product. For example, the average size of a Caramel éclair transaction
during January was $238.00.
6. DRILLING DOWN
A nice feature of a pivot table is the ease with which you can "drill
down" to the data that was used for a pivot table
CAPTION
Put your cursor in the cell containing the average Caramel éclair sales
in January. Now double-click on that cell and you will see (in a separate
worksheet) the 5 transactions involving Caramel éclair sales in January.
CAPTION
Right-click on any cell in the Data portion of the pivot table and select
Value Field Settings. This brings up the Value Field Settings dialog box.
Select Show Values As and select Percentage of Column. After hitting
OK we see a month-by-month breakdown of the percentage sales by
product. For example, June was our best month for Caramel éclair sales
(15.42% of Caramel éclair sales were during June).
8. ANALYTICAL POTENTIAL
CAPTION
3
Put your cursor anywhere inside the data. And select Insert Pivot Table.
Then click OK from the Create Pivot Table dialog box and select OK.
Now you will see the Field Settings dialog box. Drag Customers to the
Row labels and Dollars to the Values section. You will now see the total
revenue that Le Napoleon has received from each customer. For
example, Le Napoleon received $567.80 in orders from Customer 2.
Click on the drop down arrow to the right of Row Labels. Select Value
Filters. Then select Top 10 and select OK. We now see a listing of our
10 best customers. Note that the customers are not listed in
descending order of sales. To list the customers in decreasing order of
sales, simply right-click anywhere within the Sum of Sales column.
Then select Sort followed by Sort Largest to Smallest. We now see a
listing of sales by customer with the best customer listed first, etc. We
find that Customer 12 was our best customer and Customer 8 was our
10th best customer.
9. ADDITIONAL OPTIONS
When you are within a pivot table you may modify many portions of
the Pivot Table by clicking within the Options or Designs portion of
Pivot Tools (located in right-hand corner of the ribbon). For example,
clicking on Design allows us to change the formatting style of the
table, the layout of the table (compact - our current format, outline or
tabular) as well as the way totals and subtotals are displayed. From the
Layout options we may change many aspects of the table including the
location in the spreadsheet, the name of the spreadsheet, the source
data etc.
We also note that the data included in a pivot table can be summarized
in a Pivot Chart. We will discuss pivot charts in the following section.
Finally, if new data is included in a pivot table, you may right-click and
select refresh to update the pivot table calculations.
10. EXERCISE
4
Determine the units sold by each salesperson of each
product.
Determine our 5 worst customers.
Determine the average number of units per
transaction sold of each product.
5
Pivot Charts
1. INTRODUCTION
One difference you will notice when you select the PivotChart option is
that when the PivotChart is the active object, the Column Labels and
Row Labels areas of the pivot table are now called Legend Fields and
Axis Fields, respectively.
CAPTION
We'll make Month an Axis Field, Product a Legend Field, and Dollars a
Value field. Excel creates a pivot table and, alongside of it, a pivot
chart.
6
will move the chart out of the way so that we can see the PivotTable
underneath it fully.
This data might be better displayed as a line chart. In the next chapter
we will see how to change an existing chart's type. The material
presented in the next chapter applies to Pivot Charts as well as regular
charts.
CAPTION
If necessary, click the pivot chart to make it the active object. Then
click and drag it using the move handle at its edge.
The Pivot Table and Pivot Chart are linked; changing the filter on one
changes the corresponding filter on the other. Thus, if we want to view
sales for January, February, and March for our three éclair flavors, we
can use either the drop-down lists in the Pivot Table or the drop-down
lists in the Pivot Chart Filter Pane. We'll use the Pivot Chart Filter Pane.
CAPTION
The pivot table and chart show us what our sales were month by
month and product by product. If we want to display only certain
months and certain products, adjustments are easy to make. If
necessary, click the pivot chart to make it the active object. Then set
the Axis filter to display only January through March, and the Legend
filter to display only the three éclair flavors. We will move the chart in
order to see that the pivot table was also updated to reflect these filter
settings.
6. EXERCISE
To add a Pivot Chart to an existing Pivot Table, select the Pivot Table.
On the Options tab, click the PivotChart button:
7
Choose the desired chart type, and a Pivot Chart will appear, linked to
the existing Pivot Table.
8. EXERCISE