File Name: Pivot Table Labs.xlsx Lab Session 1: Create Simple Pivot Table with a Date Grouping Note: Instructions for the first lab are very detailed because it might be the first time you have created a pivot table. Future labs will be more goal oriented rather than providing step by step instructions, but answers/tips are also provided below the labs when applicable. 1. Select cell A3 in the tab called Lab One (only one cell!) 2. Use the Insert Ribbon to add a Pivot Table to the data. Keep the default settings as displayed to place your pivot table on a New worksheet 3. Drag and drop the fields into the categories as shown below: 4. Compare the upper left part of your pivot table to the following image: Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 1 of 15
5. Group the dates to be by Year a. Right click any date in Column A (i.e. Cell A6) b. Select Group and change the dialog to match the following image Compare your pivot table to this image: 6. Select Cell B1 Limit the data to ABC Headstart and BOCES (you will have to select the checkmark in the lower right corner labeled Select Multiple Items 7. In the Pivot Table field list (which appears along the right edge of your spreadsheet when your cursor is positioned in the pivot table), move the County field from the Row Labels position into the Column Label position compare your pivot table to the following image Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 2 of 15
8. Add a grouping by Date Quarter. (Repeat Step 5 but add Quarters!) Compare your pivot table to the image on the worksheet tab labeled Completed Lab One Suggestions on what might make this look better? END OF LAB ONE Lab Session 2: Recreate the Pivot Table and add Enhancements 1. Read the list of enhancement suggestions on the tab called Completed Lab One 2. Recreate the same Pivot Table that you had when you were finished with Lab 1 (field positioning is shown below). Group the date field by Years and Quarter (right click inside one of the date fields, select Group). When done, the Pivot Table field list will look like this: 3. Complete each of the suggested improvements. (Detailed and/or abbreviated tips follow) Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 3 of 15
Feeling brave? Use the abbreviated Tips section in the blue rectangular text box above for help in accomplishing the suggested improvements. Detailed help is included below for each of the recommended improvements. When done, compare your results to the bottom image on the worksheet tab Completed Lab One Detailed how-to s: 1. Select outline layout. a. Position cursor in pivot table b. Select Ribbon Pivot Table Tools Design Layout group Report Layout Option c. Select Show in Outline Form. 2. Add Zeroes for blank cells. By this we mean to replace any blank cell in the pivot with a zero. a. Right mouse click inside Pivot Table, Select Pivot Table Options b. On the Layout and Format tab, enter a 0 as shown in the For empty cells show entry Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 4 of 15
3. Add Subtotals. Use the Pivot Table Tools Design ribbon, first button Subtotals Show all Subtotals at bottom of group 4. Add Shading. Use the Pivot Table Tools Design ribbon, Pivot Table Styles group, click dropdowns to see various styles and select a color/style of your choice 5. Modify Labels. For example the words Sum of Attendance in cell A3 seems unwieldy. Select that cell and then type the words Attendance Totals in the formula bar. Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 5 of 15
6. Display all quarters even if there is no data. Notice that the year 2014 does not have a Qtr 4 entry. a. Right click cell B24 (Qtr 1) b. Select Field Settings from right mouse menu c. On Layout and Print tab select Show items with no data. d. Click OK. e. See the circled items in this next screenshot to see a drawback of doing this but we can get rid of that too! f. In Cell A4 (Years), use the dropdown to open the filter options as shown below. Uncheck the boxes for <1/2/2011 and > 8/7/2011 as shown. This will clean up the pivot table to only display the four years. Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 6 of 15
7. Sort Year in Descending Order. a. Right click one of the year cells (i.e. cell A5) b. Select the appropriate sort option as shown 8. Add a Slicer for the school. a. Position cursor in pivot table b. On the Pivot Table Tools Analyze ribbon Sort and Filter group / Insert Slicer (Ribbon is called Options in Version 2010) (Note: this feature is not available in Version 2007) c. Select School and click OK d. Play around with that slicer! Select one object with a single click. Select multiple objects by holding down the control key as you select (pivot table changes when you let go of the control key). Clear all objects by using the clear filter icon in upper right corner of slicer. END OF LAB TWO INSTRUCTIONS. Compare your results to the bottom image on the tab Completed Lab One Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 7 of 15
Lab Session 3: Filters / Drill downs / Multiple Values Pre-lab instructions: If you want the challenge of doing this exercise unguided, the main instructions for each step are in italics. 1. Skim the data on the Lab Three tab. 2. You are going to be stranded on a desert island for one month, and can only take TWO food types (Column B) with you. You want to know which food type has the highest average amount of calories (Energy column) per item. a. Create a pivot table to support your decision by bringing these fields into the Pivot Table field list as shown. Use the drop down arrow to the right of the Energy [kcal] field to change the summary type to Average. b. Change the decimals on the average to be 2 decimal places. Right click any one of the numbers currently representing the sum of the energy field, and select Value Field Settings. You could also use the drop down arrow that was used in step a above! The Value Field Settings dialog box, first tab, has a button labeled Number Format in the lower left corner. This is the best way to format numbers in a pivot table. Tip: When you right mouse click in a pivot table column, the number format option is one of the menu choices. It will appear to work on the entire pivot table, but formatting results can be inconsistent on refresh and after making other pivot table changes! You should also avoid using the home ribbon to change number formats. c. Sort the results from high calorie to low. Position the cursor on any one of the average values in your pivot table, right click, and select Sort, sort largest to smallest. 3. Using the drill-down feature, create a grocery list of all items represented by the Nuts, Seeds and Products total. (How? Simply double click cell B5 you will be on a new worksheet!) 4. Return to your pivot table worksheet tab and note that the two food types with the highest average of energy are Fats and Oils and Nuts, Seeds and Products. 5. Add the Food field (Column A) to your pivot table as a row label. Your Pivot table field list should look like this: Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 8 of 15
6. Change the layout of your pivot table to tabular. (How? Pivot Table Tools Design Ribbon, Report Layout button, select Tabular format.) 7. Filter your pivot table to only display Fats and Oils and Nuts, Seeds and Products. (How? Right click the Food Type label (Cell A3) and set the filter bot both groups screen shot below) 8. Take a good long look at the food you ll have for the next month. Groan. 9. Let s replace Fats and Oils with Grain Products by changing the filter options. Use the filter icon in cell A3 to uncheck Fats and Oils, and check Grain Products. 10. Add the average fiber to your pivot table in the Values position. (How? Drag the fiber field from the Pivot Table field list into the Values box in the lower right corner of the Pivot Table field list.) 11. Change fiber field settings to display the Average AND display two decimals. (How? Right click any one fiber value, select Value Field Settings, change the summary type of Average, and use the Number Format button to modify the decimals). 12. Clear all filters. (How? Use any of the funnel icons!) Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 9 of 15
13. Add a filter to your pivot table to only display food items with more than 3 average grams of fiber. Select the Food filter icon (not the Food Type!). Select Value Filters, Greater Than or Equal To 14. Change the report layout to Compact (Design ribbon, Report Layout Show in Compact Form. 15. If necessary, change the Subtotals option on the Design ribbon to display Subtotals at the top (Design ribbon, Subtotals Show all Subtotals at Top of Group 16. Compare your pivot table to the one shown in the worksheet tab Completed Lab Three Brain teaser: Sally created a pivot table, putting it on an existing worksheet rather than a new worksheet. When she modified a value setting to be averages, her average column was nicely formatted with two decimals. Joe created the same pivot table, but his average column had a mish-mash of decimal settings. How could this happen? END OF LAB 3 See tips that follow Report layouts impact filtering. Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 10 of 15
Brain Teaser Answer: Sally s existing worksheet cells had been previously formatted. Lab Session 4: Report Filters / Row-Column Value Swap / Drill downs / Page Creation If you have difficulty with any of these steps, tips are provided at the END of this lab session. Pivot cache sharing may require ungrouping the date fields before doing this lab. 1. Go to the tab labeled Lab Four. If your PivotTable field list contains the field Year, do step 2. If your Pivot Table field list does not contain the field Year, proceed to Step 3. 2. We need to remove the grouping that was done from an earlier pivot table that was based on the same data. To accomplish this: a. Drag the Service Date field into the Row Labels box b. Right click any field that represents a date grouping in your pivot table and select Ungroup (i.e. if the data in a previous lab was also grouped by quarter, your pivot will contain labels for Qtr1. Right click that label. Alternatively, you can right click directly on the label Service Date. ) c. When done, you should have all dates displayed in the pivot table. d. Drag the Service Date field BACK up into the Report Filter box. 3. Move the Values total in the Column Labels to the Row box. The Pivot Table Field List will look like this: Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 11 of 15
4. Next we will group the Service Date by years so we can add that to the Report Filter. a. Move Service Date down into the Row Labels box b. Right click any date in the pivot table and select Group highlight years only. Click Ok. c. Drag the Service Date field from the Row Labels back up into the Report Filter box as displayed: Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 12 of 15
5. Filter the data to the Year 2012. Your pivot table should look like this: 6. A coworker tells you that the Ontario numbers for Chutney Elementary appear incorrect. You are asked to provide the detail records for the student count of 116 appearing in Cell E8. Double click Cell E8 to create a drill down worksheet 7. Clear the Service Date Filter. 8. Create a separate page for each of the Years represented by the Service Date using the Show Report Filter Pages option off the PivotTable Tools Ribbon, Options selection as shown: 9. Check out the new worksheet tabs that were created. You will probably have to use the arrows in the lower left corner of the spreadsheet to reposition the tabs so you can see them. Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 13 of 15
10. The tabs for Year 2011 through 2014 look great but check out the worksheet tabs on either side of those. a. Why do you think Excel did not name those two tabs with a meaningful name? Worksheet tabs cannot contain symbols! Sheet 6 represents <1/2/2011, which is not a valid worksheet tab name. b. We could have prevented the creation of those two worksheet tabs by filtering our data to display only the years 2011 through 2014. 11. (Optional info on worksheet tab grouping) Save the file. If you have no questions on those new worksheets, delete all four of the new worksheets. You can delete all four at once: a. Select the first sheet tab with a right mouse click b. Hold down the shift key, then click the last sheet tab that you want to delete. c. Notice that all four sheets are now selected (the color of the tabs is white). d. Look at the top of the application window and notice you are in [Group] mode. Any changes done to any of these four selected sheets will impact all of them! Right mouse click any one of the selected tabs, select delete. BONUS: Finished early? Create a new pivot table from the Date Pivot Data tab that shows the minimum and maximum attendance (Col D) for each county, each school (no date filter). Compare your results to those on the worksheet tab labeled Bonus Lab Four Completed END OF LAB FOUR Lab Session Five: Sorting and Grouping 1. Go to the tab labeled Lab Five. View the image on the tab Lab Five Completed. This is your end goal: displaying the data by District, with the ability to expand the data to view County totals. Information required: Erie and Monroe are in District A; Wayne, Ontario and Seneca are in District B. 2. First Sort the data to enable easy grouping by District, with a secondary sort by County name (i.e. District B counties will appear in alphabetical order. 3. Add Groupings. 4. Add Row Grand Totals. 5. Collapse the Groups. Compare your pivot table to the image on the tab Lab Five Completed. 6. Expand District B. 7. Change the row sort order by the Grand Total sorting from largest to smallest. Compare your pivot table to the image on the tab Lab Five Completed. END OF LAB FIVE see answer tips below Step #2: a) Right click cell C5 (any county label), select Sort, More Sort Options. b) Select Manual and click okay c) Drag and drop the County Label headings putting Erie and Monroe first, then Ontario, Seneca and Wayne. Step #3: a) Select cells B5:C5 (Erie and Wayne labels) right click, select Group Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 14 of 15
b) Position cursor in the formula bar and change the text Group 1 to read District A c) Select cells D5:F5 right click, Select Group. Change the label in Cell D5 to read District B. Step #4: Design ribbon, Grand Totals dropdown Step #5: Use the minus sign to the left of the groups Step #6: Use the plus sign to the left of District B Step #7: Right click any value in the Grand Total column, select sort. Lab Session Six: Pivot Chart Let me start this lab by saying if you want a chart to accompany an existing pivot table, it is as simple a matter as clicking the Pivot Chart button on the Analyze ribbon! In earlier versions of Excel, you had the option to select Pivot Table AND Chart when first building the pivot. 1. Go to the tab labeled Lab Six. 2. Create a pivot table that will show the total sales (Pre-tax column) for each sales person, with the ability to filter the report by Category (column G) 3. Add a pivot chart by clicking the Pivot Chart button on the Analyze ribbon (Options ribbon in version 2010) 4. Use the chart tools ribbon to modify the chart title and add data labels. 5. Add two slicers: one for Category and one for the Weekday (a number 1 through 7 that represents the day of the week). (Tip: slicers are not limited to fields in the Report Filter Pages position!) 6. Test the slicers! One possible solution is shown on the tab labeled Lab Six Completed END OF LAB SIX see answer tips below Steps will vary depending upon personal preference. General guidelines: Chart layout: Immediately after creating your chart, you can use the Design ribbon, Chart Layouts section to apply a layout template of your choice Data labels: Right click the chart, Format Data Labels (OR use Layout Ribbon, Data labels choice). Number formats for Data labels are done via the Format Data Labels option select Number in the navigation pane. Fonts / size for data labels is done via the Home Ribbon. When selecting data labels, one click on any one data label selects all. Click a second time and only one of the data labels will be selected. Chart title: Layout Ribbon, Chart Title choice can be used to modify the title. Select text and use the Home ribbon to change font sizes / font style if desired. Data labels can also be formatted using the Home ribbon (font size/style). Adding number formatting is done via the right click, Format Data Labels choice Number option on the left. Plot size: Usually the pie chart plot size needs to be enlarged. The plot area can be selected by clicking outside the edge of the pie chart, OR use the first dropdown on the Layout Ribbon select Plot. Sizer arrows will appear for the plot area. Slicer: To add Slicer, go to Pivot Table Analyze (Options in Vs. 2010) Ribbon, sort and filter group, select Insert Slicer. A Power Point slide that covers key concepts from this webinar can be downloaded with this link. This slide was intentionally put together as a reference source vs. providing bullet points! Security Tech Tip: Double clicking any total field in a pivot table will create a separate worksheet of the individual rows that make up this total. When a pivot table has a grand total, you can use this to recreate all of the data that was used in the creation of a pivot table! This COULD pose a security problem if you do not want users to view the detail! Preventing users from accessing this data requires (a) in pivot table option dialog box, uncheck Save Source Data with File ; (b) Complete the dropdown labeled Number of fields to retain to be None ; (c) Delete the source data in the spreadsheet; and (d) Disable the connection. Excel Pivot Tables Labs Updated: 11.9.16 2016 Cindy Kredo Page 15 of 15