Vous êtes sur la page 1sur 13

Pivot Tables We have learned how to use Excels chart wizard to create visual representations of data tables.

The chart wizard is very useful when the amount of data you have is relatively small and limited to a few categories. School leaders are often faced with large data sets that contain many kinds of information about all the students in the school. ivot tables offer a fast and efficient way to analyze large data sets without having to learn complicated methods of sorting and filtering the data. This tutorial will guide you through the process of formatting a data set for use with pivot tables! using pivot tables to analyze data! learning about features and functions of the pivot table! and using the pivot table to generate tables and charts from the source data. Formatting a Data Set When deciding whether to use pivot tables to analyze a data set! there are a couple of things you should consider. "irst! pivot tables are most useful when you have a data set that has a large number of distinct categories #at least three$. The power of pivot tables lies in the users ability to slice the data in a variety of ways. This is also known as %disaggregating& or %creating cross'tabs&. (ets look at the sample data we have in our Excel workbook. )pen the workbook and select the *+)T ,-T- worksheet at the bottom of the screen. .ou will notice that this data set has twelve categories of information about each student in a particular grade. *t does not matter whether the information in the table is numeric or text'based! but there are a number of powerful features you can use on numeric data.

Col mn !ea"ings for Data Categories

Select PIVOT DATA tab from bottom of worksheet

The formatting of this data set illustrates the second important criterion for using pivot tables / all columns in your data set must contain a header that appears in one row directly above the data. *f you have a page title for the data set! or other information appearing at the top of the worksheet! you must modify the data range in the pivot table wizard. Setting #$ the Pivot Table To begin using a pivot table! select ,ata from the menu bar and then select the ivot Table and ivot0hart 1eport option. The ivot Table Wizard will open and ask you to specify the source of the data and the type of report youd like to make. 2ake sure the first option is checked in each category and select the 3ext button. %& Select Data from 'en (ar

)& Select Pivot Table an" Pivot Chart *e$ort

+& 'ake s re the first o$tion is checke" in each hea"ing

Step 4 of the ivot Table Wizard asks you to specify the range of the data to be analyzed. *n this example! Excel has selected only the first row of the worksheet which contains the title of the data table. Select the small box at the right of the range box to select the range for this pivot table. Select cell -5 and scroll down the spreadsheet until you reach the bottom of the data set. While holding down the Shift button! click on cell (67. 8it enter and then select 3ext on the ivot Table Wizard box. Select the 3ew Worksheet option from page 5 of the ivot Table Wizard page and click "inish.

%& After selecting "ata range, hit -nter

)& !it .e/t on the ne/t bo/

+& Select the .ew 0orksheet o$tion an" click Finish

#n"erstan"ing the 0a1 Pivot Tables are 2ai" O t - new worksheet will appear with a blank pivot table in the upper left corner and the ivot Table "ield list on the right.

Pivot Table

Fiel" 2ist

.ou can move the ivot Table "ield (ist to a more convenient location by clicking and holding the top of the field box and dragging it to the desired location. .ou can think of this ivot Table as a blank slate that allows you to play around with different fields from you original data! which remains untouched in the spreadsheet where it started. The ivot Table "ield list is a collection of the column headings from your original data table. .ou can select any one of these fields for inclusion in your pivot table. ivot tables operate on a %drag and drop& procedure. To move the fields into the pivot table! you simply select one! hold down the left mouse button and drag it to the pivot table. The pivot table is divided into four separate regions9 the data field! the row field! the column field! and the page field. The data field is where you place items that you want to count! average! or total. 1ow and column fields work identically to subdivide the data into meaningful categories. The difference between row and column fields is purely cosmetic / a data field with a long title might look better in the row field than in the column field where it will make the table very wide and difficult to read. The page field is similar to the row and column fields! but it allows you to filter all the data in the pivot table by a chose criterion.

Anal13ing Data with Pivot Tables 3ow that we have learned the basic functions of the pivot table! lets practice using the table to analyze the grade level data. Suppose * wanted to know how these :th graders did on the math test by race;ethnicity. 0lick and hold on the 1ace;Ethnicity icon in the field list. ,rag the icon to the pivot table and drop it in the row field. .our pivot table should now show the six ethnicity categories from your original worksheet. 3ow select the erf. (evel icon from the field list and drag it to the column field. .ou will now see the performance levels across the top of the pivot table. 3ow select the Student *,< icon and drag it into the data field of the pivot table. .ou will see some very large values in the table when you do this. This is because the pivot table defaults to s mming the data that you place in the data field. What we want here is a co nt of the students who fall into each category. To correct this! click once on one of the values in the data field and then right click. Select the "ield Settings option from the menu. =nder the %Summarize >y& heading! select the 0ount option and click )?. .our pivot table now displays the number of students in each proficiency level sorted by race.

%& *ight Click

)& Select Fiel" Settin gs

+& Select Co nt an" click O4

What makes pivot tables so powerful and useful is they allow you to @uickly change the data which you display and how you display it. 3ow suppose you wanted this performance level information divided by math teacher rather than race. Select the 1ace;Ethnicity heading in the row field and drag it back to the field list. 3ow select the

2ath Teacher icon and drag and drop it in the row field. The pivot table now shows the performance levels of the eighth grade students by math teacher.

.ou can also place more than one category in the row or column fields. Suppose you wanted to know the performance level of girls and boys for each math teacher. Select the Aender icon from the field list and drag it to the row field. The pivot table will now re' sort the data to show the performance of girls and boys for each math teacher.

.ou can also add multiple fields to the data field area. Suppose that we wanted to know not only the count of students in each performance field! but also the percentage of each teachers class that fell into a given performance level. Select the Student *,< icon from the field list and drag it into the data field. .ou should now see two sub'rows for each teacher / the count of Student *,< and the sum of Student *,<. )nce again! Excel has defaulted to assuming we are interested in knowing the sum of student *, numbers! which we are not. We want to know what percentage of a teachers students ended up in each performance level. To change the kind of calculation Excel performs! select any one of the cells that shows a sum of Student *,< and right clickB select "ield Settings from the menu. =nder the Summarize >y heading! select 0ount. 3ow select the 3umber option from the buttons at the right. =nder the 0ategory heading! select the ercentage option and change the ,ecimal laces option to zero. 0lick )?. 3ow select the )ptions tab below the 3umber tab. =nder the %Show ,ata as& heading! select the drop down menu and choose the %C of row& optionB click )?. %& *ight Click on a S m of St "ent ID5 cell )& Select Fiel" Settings +& Select the Co nt o$tion 6& Select Percentage an" set Decimal $laces to 3ero 7& Select O$tions an" select 8 of row from the Show Data as hea"ing

The pivot table now shows the number! and percentage! of students in a given performance level for each teacher. The final two rows of this table show the number and percentage of all eighth graders in each performance category.

3ow lets compare each students performance level with his or her math grade. To help keep the table readable! lets eliminate the second 0ount of Student *,<s by selecting the small downward facing arrow in cell >D. ,eselect the check next to the %0ount of Student *,<4& option and click )?.

Deselect Co nt of St "ent ID5)

3ow drag the %2ath )verall Arade EF'EG& icon into the data field. 1ight click on the %Sum of 2ath )verall Arade EF'EG& cell and select the "ield Settings option. 0hange the %Summarize by& option to average! select the 3umber tab and choose the 3umber option and set the decimal places to zero. 0lick )?.

Select . mber Select Average

Select . mber from Categor1 an" set Decimal $laces to 3ero

The table now displays the average math score for students in each performance level by math teacher. The bottom row shows the average grade for all eighth graders by each performance category

ivot tables are also useful for filtering the larger data set. Suppose you wanted a list of those eighth graders in the failing category. 0ell "H6 of the table shows the total number

of eighth graders who scored in the failing range of the math test. *f you double click on this cell! Excel will generate a list of the failing students from the overall data set. 0licking any value in the data field will generate a list of students who fit the designated criteria. After "o ble9clicking on the cell, this table will a$$ear in a new s$rea"sheet& This s$rea"sheet shows all the failing st "ents in the school with com$lete "emogra$hic information&

-lthough the information in this table is very useful! you might decide that you actually want each teachers data to be in a separate table. We can avoid a table that appears cluttered by using the % age "ield& of the pivot table. ,rag and drop the %2ath Teacher& icon from the 1ow field to the age field. .ou will notice that the table size is reduced! and only the :th grade totals are displayed. The page field now allows you to sort this entire table by any one of the teachers from our data table. Select the small downward facing arrow in cell >H. Select Aordon from the list and click )?. The pivot table now changes to show the number of Aordons students in each performance level and the average math score. .ou can change the page field to reflect the performance of any math teacher in your data.

We have shown you only a few options and functions of the pivot table. The best way to get a feel for using pivot tables is to experiment with them for yourself. The drag and drop functionality of pivot tables easily allows you to correct mistakes that you might make in building your tables. ( il"ing Charts from Pivot Tables -fter creating a pivot table! you may find that you would like to create a chart from the data table you have created. *t is possible! but not advisable! to create a chart directly from a pivot table. Every pivot table you create and save within an Excel workbook causes the Excel file size to increase dramatically. -fter creating and saving a few pivot tables! you will have an Excel file that is very large and difficult to work with. *n

addition to the file size issues! the chart options are limited when working directly from a pivot table. To avoid the problem with expanding file size! it is wise to copy the data from the pivot table and paste it in a separate worksheet. We will only save the values from the pivot table! not the underlying e@uations that created those values. "irst drag the 2ath Teacher field from the age "ield back the 1ow field. 3ow select cell AH: #the bottom right corner of the pivot table$B hold the left mouse button and drag the cursor up and to the left to select all the data in the table. There is no need to include the % erformance (evel& column heading. To copy the data table! press 0ontrol I 0 on your keyboard. .ou should see a flashing box around the data in the table. Select *nsert from the 2enu >ar and choose the Worksheet option.

)& Select Insert from the 'en (ar an" choose the 0orksheet o$tion %& Select all the "ata in the table an" $ress Ctrl :C

Select cell >4 from the new worksheet and right click. 0hoose the % aste Special& option from the menu and select %+alues& from the aste options. 0lick )?.

Select the Val es o$tion an" click O4 *ight click in cell () an" select the Paste S$ecial o$tion

The data from the pivot table now appears as a regular table in Excel. .ou may want to format the table as we have learned in previous lessons. .ou can now use the chart wizard to create a variety of charts from the data in this table. ;etting (ack to the (lank Slate -lthough ivot Tables may seem a bit complicated at first! they are an excellent tool for analyzing data. With ivot Tables you are free to experiment with different methods of slicing the data because the underlying data in the spreadsheet is unaffected by any actions you perform in the ivot Table. -s you experiment with creating tables! you might find combinations of data that do not form a table that is easy to read or understand. .ou can easily correct this problem by dragging all the fields in the pivot table back to the "ield (ist box and starting over. =sing ivot Tables in this way can help you uncover trends or relationships in the data that you might not have seen by examining a static spreadsheet.