Pivot Table is commonly used to extract, summarize and analyze data. With a pivot table, user can transform numerous rows of data into a concise summary report within seconds.
Let's start from the basic, walk through a simple example, using the following table as our data source to construct a Pivot table.
Create Pivot Table
Click any cell inside the source data table.
Then, go to ribbon, select "Insert" tab.
Under Insert tab, select "Pivot Table"
The "Create Pivot Table" dialog box will pop up.
It has already pre-selected the source data range. Check to ensure the whole data source table has been included.
Then, select "New Worksheet" for our Pivot Table.
In the new worksheet for the Pivot Table, we can see that it is still a blank worksheet. There is no Pivot table yet. That's because user have to tell Excel what to include in the Pivot table and how should the Pivot table be presented. These can all be done in the "Pivot Table Fields" box.
"Pivot Table Fields" box is located on the right hand side of the new worksheet. It is through this box user tells Excel how the pivot table should be constructed.
The "Pivot Table Fields" box has two sections. The top part is the Fields section, and the bottom part is the Area section.
The Fields section contains all the fields of the original data table, and user can select any fields to be used in the new pivot table, just by checking the box next to the field name.
The Area section is for users to decide how to arrange those selected fields. There are four small boxes in the Area section: "Filters", "Columns", "Rows" and "Values".
Placing a data field in the "Columns" area will display the data in a column-oriented perspective, with headings stretch across the top of the columns in the new pivot table.
"Rows" area fields are displaying as rows in the new pivot table.
The "Values" area calculates and counts data. The data field that you drag and drop there are typically that you want to measure.
"Filters" area is an optional set of one or more drop list at the top of the pivot table. Placing data fields into the "Filters" area allows users to filter the entire pivot table based on selections. The types of data field that you might drop there should be those that you want to isolate or focus on; for example, customers, products or employees.
Once user checking the field lists in the "Fields" section, Excel will automatically allocate the fields to Area section. By default, Excel will automatically place non-numeric fields to the "Rows" area, numeric fields are added to the "Values" area, Date and time will be added to "Columns" area. Of course, users can always drag the fields between areas to customize out their own pivot table.
As an example, we select four fields:
Customer/Item/Amount/Months, drag and place them into the following boxes of the Areas section:
Customer -> Filters
Items -> Columns
Date -> Rows
Amount ->Values
Following is the resulting pivot table:
As "Customer" is the Filters, we can use the filter button at B1 to select any particular customer for our review.
In order to check the table is properly produced, we first select "All" at "B1" to compare the total of our Pivot Table with the original data table, both giving $151,745 as the Grand total.
From the resulting pivot table, we can see that with a pivot table, users can quickly categorize unorganized data into groups of meaningful data.
By using a pivot table, the original data set doesn't have to be changed, but the pivot table itself can be changed dynamically to do different analyses based on user's specifications, and interactively drilled down to detailed records.
In our example, the pivot table helps us to have a clear picture of our sales by product on a monthly basis. And, by clicking the filter button at B1, we can also select individual customers to see how we perform towards each of them. In the following table, we select customer "DEF" at B1, the resulting table shows how we perform towards them in last calendar year.
Grouping Dates
With Excel 2016, Microsoft has added some new features for grouping, sorting, and filtering. Grouping dates is one of those new features.
In our Pivot table, all dates have been automatically grouped into their respective months.
By clicking the plus(+) icon of the respective month, Excel will expand that month to show the detailed transactions by dates. In our table, we select to show the detailed transactions in January.
Data Changed
(A) Pivot Table needs to be "Refresh" each time the source data has changed
In our example, we have made some changes to the source data.
New unit prices been used for products on Row 92 to Row 100, which in terms also affected the respective sales amount and the grand total of the whole table.
To update the change, click any cell inside the Pivot Table. Go to Ribbon, select "Analyze" -> "Refresh" -> "Refresh"
After "Refresh", the pivot table is updated, as can be seen from the new grand total.
(B) If source size varies (i.e. adding or deleting rows/columns), user has to re-define the range of source data
In our example, we add 5 rows to our source data table.
To update, right click any cell inside Pivot Table. Go to ribbon, select "Analyze" -> "Change Data Source" -> "Change Data Source"
Once we click "Change Data Source", Excel will bring us back to the original worksheet of the data source table, and the "Change Pivot Table Data Source" dialog box will pop up as shown above.
The dialog box will first pre-select the range of the old data source, this must be changed to include the new additions, and click "OK" to update the new range.
Following is the updated Pivot Table: