Excel Pivot Tables
Excel Pivot Tables
Excel Pivot Tables
Pivot tables are an Excel feature that you should learn how to use. Instead of analyzing rows upon rows of records, a pivot table can aggregate your data and show a new perspective and few clicks. You can also move columns to rows or vice versa. The problem is people believe creating a pivot table is too difficult to learn. Grab a seat and well walk you through this mini tutorial using Excel 2007.
Voter ID Party Affiliation Their precinct Age group When they last voted Years theyve been registered Ballot status
Looking at the first 20 data records, you can see the data is boring. Its enough to make you roll your eyes and fall asleep. In this format, the key question it answers is how many voters exist in all the precincts. Using Excel pivot tables, you can organize and group the same data in ways that start to answer questions such as: What is the party breakdown by precinct? Do voters use permanent absentee ballots? Which precincts have the most Democrats? How many voter pamphlets do I need for Precinct 2416? Do 18-21 year olds vote? A pivot tables allow you to group the spreadsheet or external data source by any of your data fields. The thumbnail below shows a count of voters by party by precinct.
Using a pivot table, I can continue to slice the data by selecting additional fields from the PivotTable Field List. For example, I can take the same data and segment by voter age group.
(2) The lower right quadrants - this area defines where and how the data shows on your pivot table. You can have a field show in either a column or row. You may also indicate if the data should be counted, summed, averaged, filtered and so on. (3) The red outlined area to the left is the result of your selections from (1) and (2). Youll see that the only difference I made in the last pivot table was to drag the AGE GROUP field underneath the PRECINCT field in the Row Labels quadrant.
8. Double-check your Table/Range: value. 9. Select the radio button for New Worksheet. 10. Click OK. A new worksheet opens with a blank pivot table. Youll see that the fields from our source spreadsheet were carried over to the PivotTable Field List.
11. Drag an item such as PRECINCT from the PivotTable Field List down to the Row Labels quadrant. The left side of your Excel spreadsheet should show a row for each precinct value. You should also see a checkmark appear next to PRECINCT.
12. The next step is to ask what you would like to know about each precinct. Ill drag the PARTY field from the PivotTable Field List to the Column Labels quadrant. This will provide an additional column for each party. Note that you wont see any numerical data.
13. To see the count for each party, I need to drag the same field to the Values quadrant. In this case, Excel determines I want a Count of PARTY. I could double-click the entry and choose another Field Setting. Excel has also added Grand Totals.
by Party. In this case, I would drag the AGE GROUP column from the PivotTable Field List down below the PRECINCT value in Row Labels.
(pivot_table_step4.png) Each age group is broken out and indented by precinct. At this stage, you might also be thinking of usability. As with a regular spreadsheet, you may manipulate the fields. For example, you might want to rename Grand Total to Total or even collapse the age values for one or more precincts. You can also hide or show rows and columns. These features work the same way as a regular spreadsheet. One area that is different is the pivot table has its own options. You can access these options by right-clicking a cell within and selecting PivotTable Options For example, you might only want Grand Totals for columns and not rows. There are also ways to filter the data using the controls next to Row Labels or Column labels on the pivot table. You may also drag fields to the Report Filter quadrant.
I prefer not adding fields to a pivot table. I think its easier to add the fields first to your source spreadsheet. The reason is you might get items out of sync if you move data unless you make them a calculated field. Pivot tables may not make the election data exciting, but it can make the analysis process easier. Without these tables, youd probably spend more time filtering, sorting and subtotaling. The other benefit is that its easy to start over by deselecting fields or moving them to another location. Feel free to download the tutorial spreadsheet below and play with the data. This will probably be the only time youre allowed to manipulate election data. Related Tutorial Files: Pivot table example spreadsheet
10