Objective: A Pivot Table is way to present information in a report format. The idea is that you can click drop down lists and change the data that is being displayed. Students will learn how to group data using pivot tables. Class Activities With your Excel worksheet open type in the following data (I have created a spreadsheet with the data in it called Pivot_Table_Data that you can open and do a copy/paste into your spreadsheet) 1
Create Pivot Table Highlight the data that will be going in to your Pivot Table (cells A1 to D37).On the Excel Ribbon, click the Insert tab. From the Insert tab, locate Pivot Tables. The Create Pivot Tables dialogue box appears: 2
In the dialogue box select the default data which you previously selected is in the Table/Range textbox. You can select different cells by clicking the icon to the right of the Table/Range textbox. You can also specify an external data source, such as a text file, for the data in your Pivot Table. Selected a New Worksheet as the place where the Pivot Table will be placed. Click OK. When you click OK, Excel presents you with a rather complex layout. The area on the right should look something like this one below: 3
4
Now take a look at the Pivot Table Field List. It has tick boxes for Month, Subject, Student, and Score. These are column headings from the original spreadsheet data. You will put the Month in cell A4 on our Pivot Table, Subject is in cell B4, Student is in cell B1, and Score is the Average scores in cells B5 to G7. You'll see how it works, though. First tick all four boxes in the field list: Excel will create a basic (and messy) Pivot Table for you. But you're going to put the 4 fields into the 4 areas below. Here are the 4 areas you can drag to: For the Report Filter, you want the name of a Student. For the Column Labels, the Subject, and for the Row Labels, the Month. The Values will be the Average scores. If you look at the Field areas after you have ticked all four boxes, however, you may see something like this: 5
Month, Subject and Student have all been grouped under Row Labels. You can drag and drop these in order to move them to a new location. If you don't fancy dragging and dropping, simply click the Student item with your left button. From the menu that appears, select Move to Report Filter. You first want to move Student in the Row Labels box. Hold down your left mouse button, and then drag it in to the Report Filter box. Move Subject from Row Labels to the Column Labels area. 6
The Pivot Table on your spreadsheet will look a lot different, too. It should look like the graphic below: Change Sum Total to Average The reason why the scores from our Pivot Table are so strange is because Excel is using the wrong formula. It's using a Sum total when you want it to use an Average. The numbers have all been added up. But we want averages, instead. To change the formula, click on Grand Total Value and select Value Field Settings: 7
You'll then see the following dialogue box: Change the Formula from Sum to Average, and then click OK. Your Average formula won't be formatted to any decimal places. 8
Format Decimal Places To format your decimal place highlight you data in the Grand Total row. On the Home tab in Excel, locate the Format, Format Cells panel. Select Number and Decimal places 0 to format your Averages so that it has no decimal places. Format student grades and Grand Total numbers to no decimal places. 9
Your Pivot Table will then look like this: Add Descriptive Names Look at cells that contain the words "Average of Score," "Column Labels," and "Row Labels." These are not descriptive names. You can click inside of these cells and type your own headings, in exactly the same way as you would to enter text in a normal cell. Change the following cells to" Average of Score - Student Averages Column Labels - Subject Row Labels - Month Center Data in Cells Next you will center the data in the cells for subject names, student grades, and the Grand Total cell. Select all the data in these specific cells and center align them using the center align button on the home tab. The data that you should center is outlined in red below. Your table should now look like this: 10
Criteria Excellent(10) Good(6) Poor(3) Values are entered into Worksheet cells A1 to D37 Data is in or in incorrect columns Columns are missing Month, Subject, Student and Score Fields are selected Student appears under Report Subject appears under Column Labels Month appears under Row Labels Sum of Score appears under Values Sum is formatted with no decimal places Student grades and Grand Total data are formatted with no decimal places Field names have been changed to Student Average, Column Label, Row Labels Subject names, student grades, and Grand Total cell are center aligned Missing one of the fields Student is inaccurately displayed Subject is inaccurately displayed Month is inaccurately displayed Some is done incorrectly Sum contains decimal places Grades and total contains decimal places One field name has not been changed One field is not center aligned Missing two or more fields Two or more fields have not been changed Two or more fields are not center aligned 11