Pivot Table Tutorial
Pivot Table Tutorial
Pivot Table Tutorial
This tutorial, authored by Brian Kovar, is part of a larger body of work titled The Pivot Table Toolkit. The Pivot Table Toolkit was published in 2009 by the Information Systems section of the American Accounting Association in the Compendium of Classroom Cases and Tools for AIS Applications, volume 4. (B. Kovar, S. Kovar, R. Vogt 2009). In a business setting, Excel spreadsheets typically contain an extensive amount of detailed data. However, the numerous rows and columns of data can be overwhelming. This makes it difficult to get a clear picture of the story that can be told by examining the data. Through the creation of an Excel pivot table, you can quickly summarize lists of data by category in a tabular format. Furthermore, this data can be pivoted, or rearranged, so that the same data can be examined from a different angle or dimension. A pivot table can summarize data into categories using functions such as SUM, MAX, MIN, AVERAGE, COUNT, as well as other Excel functions. You can even display pivot table data as a percentage of the grand total for the data being examined. A pivot table is an interactive data-mining tool that can be used to extract information from the raw data that is being examined. All areas of business (accounting, marketing, finance, management) use pivot tables as part of their data analyses. Employers recruiting students from universities for internships and post-graduation jobs include the skills of building pivot tables and being able to interpret the data found in pivot tables as part of their desired skill sets. This is further seen in business advisory board meetings conducted by university departments where board members indicate the need for student pivot table skills and improved student pivot table skills. Despite this importance, many students wonder what are pivot tables? and how do you build a pivot table? often indicating that I have never heard of pivot tables before. Contributing to this problem is that many textbooks that cover spreadsheet skills include minimal pivot table coverage. Pivot table coverage is often toward the end of the textbook because textbook authors consider pivot tables to require advanced skills. The goal of this tutorial is to overcome that. In order to build a pivot table and conduct your data analysis, the following dimensions of data should be specified. The field to be used to create row items in the pivot table. The field to be used to create column headings in the pivot table. The field or fields to be used as data items. At its most basic level, a pivot table is composed of rows, columns and data. Once the basic concepts of pivot table creation have been mastered, more complex and advanced pivot tables can be created. Examples of more advanced and complex pivot tables include: A pivot table that has rows, but not columns. A pivot table that has columns, but not rows. A pivot table that can be filtered using an additional data field. A pivot table that contains multiple fields as data items, often displaying data being summarized using different function operators. 1
As part of this tutorial exercise, you will gain experience building pivot tables, starting with simple pivot tables and then progressing to more advanced and complex pivot tables. The Scenario Recently, you have been hired by Pro Golf USA, a seller of golf equipment and apparel. One of the first tasks you have been given is to help the company analyze the extensive amount of customer data that it has collected in an Excel spreadsheet in the worksheet called GolfData. A sample of that data has been included as part of this narrative. Understanding each of the fields contained in the spreadsheet is an important component that will assist you in your data analysis. The spreadsheet contains the following fields: CUST ID: Serves as a unique identifier for each customer. REGION: The sales area has been categorized into one of four regions (north, south, east, west). PRO SHOP VS RETAIL STORE: Pro Golf USA sells to golf course pro shops and retail stores. YEARS AS A CUSTOMER STORE SQUARE FEET: In order to better understand the customers of Pro Golf USA, data have been collected regarding the size of each of the pro shops or retail stores that is a customer of Pro Golf USA. Customer stores have been categorized into one of four categories, based on square feet of the store (Less than 1,000 square feet; 1,000 to 5,000 square feet; 5,000 to 10,000 square feet; Greater than 10,000 square feet). TOTAL DOLLARS PURCHASED: This field represents the dollar amount that Pro Golf USA received from a given customer in the last year. NUMBER OF PURCHASES MADE. This field represents the number of orders that a given customer placed with Pro Golf USA in the last year.
After making sure that you understand the data that you will be working with, it is now time to begin your analysis. You will use the GolfData sheet to create the first 6 pivot tables described in this tutorial. Determining the fields that comprise your pivot table Your first data analysis task is to analyze the total dollars purchased by region and the category of Pro Shop vs Retail Store. Prior to using Excel to construct a pivot table, a user must visualize in his or her mind the general layout of the pivot table. This is probably the biggest challenge for someone who is a novice in regards to pivot table creation. Without this visualization taking place, the user will be at a loss as to what needs to be done. The starting point is the problem statement: the total dollars purchased by region and the category of Pro Shop vs Retail Store. The word by, or similar wording, can serve to differentiate the fields that comprise the data from fields that comprise the rows or columns of the desired pivot table. Prior to the word by is total dollars purchased. This serves as the indicator of the field that you want to analyze. After the word by are the words region and Pro Shop vs Retail Store. Region can serve as the row (or column) of your pivot table and the category of Pro 2
Shop/Retail Store can serve as the column (or row) of your pivot table. It does not matter which of those two fields serves as the column or row since both combinations yield the same results. Therefore, the first pivot table will be comprised of the following: Region will occupy the row fields position in the pivot table. The category of Pro Shop vs Retail Store will occupy the column fields position in the pivot table. Total Dollars Purchased will occupy the data items position in the pivot table. Once the required fields have been determined, it is now time to construct the actual pivot table. Open the file called Pro Golf USA Pivot Table Data.xlsx Place the cursor on one of the records that is displayed in the spreadsheet. Using the Excel ribbon, click on the Insert tab, and then click Pivot Table. The Create Pivot Table dialog box should now appear. Make sure that all of the data that you wish to analyze are highlighted, which should be the range of $B$4:$H$491. You should also select where you want the new pivot table to be placed, either on a new worksheet or in a specified location within the current worksheet. Make sure that New Worksheet is selected. After selecting those options, click OK, and the skeleton structure of a pivot table should now appear as a separate worksheet.
The pivot table skeleton is comprised of three main areas. On the left-hand side of the screen, you can see the actual pivot table. Fields of information will eventually be dropped into this area. On the right-hand side of the screen, you will find the Pivot Table Field List and the Pivot Table Layout Areas. The Pivot Table Field List is simply a listing of all of the available fields in your spreadsheet that you can use in your Pivot Table. The Pivot Table Layout Areas are individual components that make up your pivot table (row labels, column labels, values and report filter). More information related to each of those four items will be provided shortly. Traditionally, pivot tables were created by dragging a field from the listing on the right over to the appropriate location in the pivot table skeleton, on the left. Beginning with Excel 2007, the default technique used to make a pivot table has slightly changed. Drag-and-drop is still used, but now, fields are dragged from the listing on the right down to the appropriate pivot table layout area, in the lower right corner. Most students find that the classic pivot table creation technique is easier to visualize and easier for students to build. Therefore, while the differences between the two views are discussed below, all of the illustrations in the remainder of the tutorial will features screen shots from the classic view. Make sure that the pivot table is still the currently selected object. The Pivot Table Tools, Options ribbon should be visible, showing various features related to pivot tables. On the far-left of the ribbon, Options should be visible. Click the drop-down arrow and Options should appear. Clicking Options should result in the PivotTable Options dialog box appearing on the screen. Select Display. A number of different display options should appear. Select Classic Pivot Table layout. Then click OK. Selecting the Classic Pivot Table layout allows you to drag fields into the pivot table skeleton grid (the way pivot tables used to be created). Now, you have the option of dragging fields directly into the grid (the traditional way) or you can drag fields into the pivot table layout area (the new way). Both ways will be described.
One of the benefits of the classic view is that it is easier to visualize the actual table that is being created (and everything seems self-explanatory to a user). The Drop Row Fields Here portion of the pivot table skeleton is used to indicate the field that forms the basis of the rows in the pivot table. This area corresponds to the Row Labels found in the Pivot Table Layout area. Dragging a field into one of those two areas causes that same field to appear in the other area (dragging a field into the Drop Row Fields Here position also results in that same field appearing in the Row Labels area). The Drop Column Fields Here portion of the pivot table skeleton is used to indicate the field that forms the basis of the columns in the pivot table. This area corresponds to the Column Labels found in the Pivot Table Layout area. Just like with the rows, dragging a field into one of these two areas causes that same field to appear in the other area. The Drop Data Items Here portion of the pivot table skeleton is used to indicate the field or fields that form the basis of the data found in the pivot table. This area corresponds to the Values found in the Pivot Table Layout area, and dragging a field into one area causes that same field to appear in the corresponding area. Simple pivot tables use one data field while more complex pivot tables use multiple data fields or the same field using more than one numerical operator (AVERAGE, SUM, MAX, MIN, etc.). Our exercises will begin with simple pivot tables and then progress to more complex pivot tables. The Drop Page Fields Here portion of the pivot table skeleton is an optional feature used to indicate the field that forms the basis of any sort of filter that you might be using to narrow down the data being displayed. This area corresponds to the Report Filter found in the Pivot Table Layout area. This is an optional feature because sometimes you will wish to filter your pivot table, while at other times, you will want to all of the records in your dataset to be considered and examined. Unless a specific filter is applied, the default setting for all pivot tables created is ALL. Recall that your task is to analyze the total dollars purchased by region and the category of Pro Shop vs Retail Store. Earlier, the specific fields used in the table were determined. Now, it is time to continue your task of constructing the actual table. Drag Region into the Drop Row Fields Here position or into the Row Labels position. When Region appears in one of those two locations, it also appears in the other location as well. 5
Your screen should now look like the Classic Pivot Table Layout shown below on the left. If you were using the default display option in Excel 2007, you would see the screen to the right. Notice how the Classic Layout makes it much easier to see what is still needed to complete the table. In addition, in the Classic Layout, you can easily place additional fields in the table by dragging them onto the pivot table skeleton. This is in contrast to the Excel 2007 pivot table layout where the fields can only be dragged into one of the four locations found in the pivot table layout area. However, do keep in mind that either layout will produce the same pivot table result. Pivot Table appearance using the Classic Pivot Pivot Table appearance using only the new Excel 2007 Table Layout. way without switching over to Classic Layout
Drag Pro Shop vs Retail Store into the Drop Column Fields Here position or into the Column Labels position. When Pro Shop vs Retail Store appears in one of those two locations, it also appears in the other location as well. After specifying the row and column information, the next required item is the data item. Drag Total Dollars Purchased into the Drop Data Items Here position or into the Values position area. When Total Dollars Purchased appears in one of those two locations, it also appears in the other location as well. At this point, the basic pivot table is complete, although there is still work that needs to be done. Notice the pivot table displays Sum of TOTAL DOLLARS PURCHASED. Since total dollars purchased is a numerical amount, the default pivot table operator is to sum the dollar amounts. Typically, when users begin their data analyses, summing amounts is one of the first things that they are interested in. However, as stated earlier, a user can find other things as well, such as the average value, largest value, smallest value, the count of items, and several others. Later in this tutorial, you will actually have a chance to perform several of those operations at the same time. 6
In a professional business setting, the appearance and format of your results is an important factor. Factors to examine when formatting pivot tables include: Narrowing down or widening out columns. (Narrowing down is most likely.) Making sure that labels and numbers within the same column are in alignment. Labels should be directly over the numbers they describe. Numbers should be properly formatted. o The currency symbol should be placed on all dollar amounts using currency style. o Numbers greater than 999 should display with a comma. o Each of the numbers within a column should be consistently formatted. Labels may need to be changed to more accurately reflect the data being shown. Apply the following formats to your pivot table. o Format the numeric data to display as currency with no decimal places. o Narrow down columns C and D to be as wide as the longest item in the column. o Change the label Sum of TOTAL DOLLARS PURCHASED so that it displays as just Total Purchased. o Narrow down column B. o Right-align the labels Pro Shop, Retail Store and Grand Total so that they are directly over the numbers they describe. Save your work. Make a printout of your results. Label your printout as Printout #1: Formatted Pivot Table. Using the pivot table that you just created, you have now decided to extend your data analysis to now show the average dollars purchased by region and the category of Pro Shop vs Retail Store. Making the necessary modification to your pivot table is actually pretty easy. Click the cell where the words Total Purchased are currently being displayed. Make sure that the Pivot Table Tools option on the ribbon is active, and the Options tab should be activated. Beneath the Insert Tab, the words Field Settings should be visible. Click Field Settings.
The Value Field Settings dialog box should display. Notice that sum is the value field used to summarize the data. Change to Average and then change the Custom Name to Average Purchased. Click OK, and a new result should be displayed. Adjust the column widths and other formatting to match the Average Purchased pivot table. After you have made the necessary adjustments, save your work. Make a printout of your results. Label your printout as Printout #2: Average Purchased Pivot Table. Using the pivot table that you just modified, you have now decided to extend your data analysis to show the average dollars purchased by region and the category of Pro Shop vs Retail Store, filtered by the size of the store (expressed in square feet). Page Fields/Report Filters are used to filter the data. Square footage of each store will be used to filter the data displayed in the pivot table. All stores are categorized into one of four categories based upon the square feet of selling space. Those categories are: Less than 1,000 square feet; 1,000 to 5,000 square feet; 5,000 to 10,000 square feet and Greater than 10,000 square feet. Making the necessary modification to your pivot table so that you can filter the data that is being displayed is actually pretty easy. Drag Store Square Feet into the Drop Page Fields Here position or into the Report Filter position area. When Store Square Feet appears in one of those two locations, it also appears in the other location as well. When the filter is first added to the pivot table, all of the data is displayed, just as it did prior to the filter being added. Click the drop-down option to the right of All. Select the Less than 1,000 square feet option. Click OK and the data displayed should change, now showing the average dollars purchased data only for stores that have less than 1,000 square feet. Click the drop-down option once again. This time, select the Greater than 10,000 square feet option, and then click OK. Now, the pivot table should show the average dollars purchased data only for stores that have greater than 10,000 square feet. Column D is wider than it needs to be. Narrow column D.
Next, look toward the lower-left of the screen. You should see two worksheets, with Sheet2 being the currently selected sheet (the sheet you have been working with). Rename Sheet2 so that its new name is First. After renaming the sheet, save your work. Make a printout of your results. Label your printout as Printout #3: Filtered Pivot Table. As you have seen, it is very easy to manipulate pivot table data so that you can view the information using multiple factors and multiple dimensions. This will be further explored in later exercises. If you wish to change the data displayed in the pivot table, it is very easy to make those changes as well. Assume you no longer want to filter the pivot table data. How do you remove a page field/report filter? Drag Store Square Feet from the Drop Page Fields Here position or from the Report Filter position area back into the field listing seen to the right of the pivot table. When Store Square Feet is removed from one of those two locations, it also removed from the other location as well. In fact, you can drag any field either onto or off of the pivot table in any way you wish to conduct your analysis. While a traditional pivot table has both columns and rows, it doesnt necessarily need both. The pivot table can have rows, but no columns. Likewise, the pivot table can have columns, but no rows. Return to the pivot table. Notice that Region forms the basis of the rows. Pro Shop vs Retail Store forms the basis of the columns. Using either the pivot table skeleton or the appropriate area (on the lower right-hand side of the screen, drag either the column field or the row field off of the pivot table. After getting rid of the row or column, you should quit without saving. Simply close down Excel and quit without saving changes. Creating a Two-Factor pivot table Your second data analysis task is to analyze the dollar amount purchased and the average dollar amount purchased, by region and the category of Pro Shop vs Retail Store. In the prior example, you examined the total dollars purchased and the average dollars purchased, but not both at the same time. In this next pivot table, you will look at both factors at the same time. Prior to building the pivot table, examine the problem statement and visualize the fields to include in each of the component sections of the pivot table. Dont forget that the information found before the word by forms the basis of the data items, while the fields found after the word by form the basis of rows and columns in your pivot table. Therefore, after examining the second problem statement, you should visualize a pivot table comprised of the following: Region will occupy the row fields position in the pivot table. The category of Pro Shop vs Retail Store will occupy the column fields position in the pivot table. Dollar Amount Purchased will occupy the data items position in the pivot table. Average Dollar Amount Purchased will also occupy the data items position in the pivot table. Notice that two data points will be the data items. Reopen the Pro Golf USA Pivot Table Data.xlsx Excel file that you closed in the last step. Place the cursor in one of the records that is displayed.
Begin by creating the basic skeleton framework for the pivot table. (You may want to switch over to the Classic Layout View, but that is also an optional step that you dont have to complete if you prefer working with the Modern Excel 2007 Layout). At this stage, do not add any fields to the pivot table. After having created the basic skeleton layout of the pivot table, it is now time to add fields to the pivot table. o Drag Region into the Drop Row Fields Here position or into the Row Labels position. o Drag Pro Shop vs Retail Store into the Drop Column Fields Here position or into the Column Labels position. o Drag Total Dollars Purchased into the Drop Data Items Here position or into the Values position area. o Drag Total Dollars Purchased into the Drop Data Items Here/Values position a second time. Notice that the resulting pivot table appears strung out and is hard to read (the more data points you add to the pivot table, the worse it gets). Additionally, notice that two Sum of Total Dollars Purchased appear in the pivot table. Having one of those displayed meets your data analysis needs, but the second does not since you wanted to see average dollars purchased (rather than total dollars summed for a second time). Our next task is to modify the pivot table in order to display the correct information, as well as make it much easier to read, interpret and understand. In the pivot table, click on the cell where the word Values is displayed (cell C3 in the image above). From within that cell, right-click the mouse. Several options should appear. Select Move Values to and then further select Move Values to Rows. Selecting Move Values to Rows results in a more concise pivot. Notice that the two Sum of Total Dollars Purchased labels are now vertically arranged, rather than horizontally spread out. This layout also makes it easier to see the data by region and the category of Pro Shop vs Retail Store.
10
IMPORTANT When moving values to rows, ALWAYS MOVE THE DATA POINTS (found before the by statement). The words after the by statement should not be moved because they form the basis of your rows and columns. Returning to the pivot table that you just made, you will next change the second Sum of Total Dollars Purchased to display the average of dollars purchased. Before making that change, you will change the text for the first summed field to Dollar Amount Purchased. To the right of the word East, the wording of Sum of TOTAL DOLLARS PURCHASED appears. Select that cell. Using the Excel ribbon, make sure the Pivot Table Tools tab is the currently active tab (select it if it is not the currently active tab). Select Field Settings and the Value Field Settings dialog box should now appear. Change the Custom Name to Dollar Amount Purchased (notice the lowercase letters). Click OK. Notice that the first row associated with each region changes to display the label of Dollar Amount Purchased. Now, click in one of the cells where the label Sum of TOTAL DOLLARS PURCHASED2 is displayed. The next task is to change the summarize value field by operator to average, and then the corresponding label for that particular field will also need to be changed. After selecting Sum of TOTAL DOLLARS PURCHASED2, select the Field Settings option and the Value Field Settings dialog box should now appear. Change the Summarize value field by operator to Average. Next, change the Custom Name to Average Dollar Amount Purchased. The resulting pivot table is seen pictured. Notice that the label for each of the values 11
contains the correct wording. However, the appearance of the pivot table can be improved. Apply the following formats so that your pivot table matches the sample pictured: o Using the currency format, format all dollar amounts to display with the $ sign, commas and no decimal places. o Right-align the labels Pro Shop, Retail Store and Grand Total so that those labels are directly over the numbers that they describe. Narrow down each of the columns so that the column widths approximately match the column widths pictured.
Rename this current worksheet so that its new name is Two Factor Table. After renaming the sheet, save your work. Make a printout of your results. Label your printout as Printout #4: Two Factor Pivot Table Showing Total Dollars and Average Dollars Purchased. After making the printout, navigate to Sheet1 and place the cursor in cell B5. Creating a Pivot Table with rows or columns (but not the other) Traditionally, pivot tables are thought of as having both rows and columns. However, that does not necessarily have to be the case. A pivot table can contain rows, but not columns. Likewise, a pivot table can contain columns, but now rows. Lets see an example of how this might work. Your third data analysis task is to analyze the average dollar amount purchased by store square feet. After examining this problem statement, you should visualize a pivot table comprised of the following: Average Dollar Amount Purchased occupying the data items position in the pivot table. The category of Store Square Feet either being a row in the pivot table OR a column in the pivot table. Placing Store Square Feet in either position will yield the same result. Now, it is time to begin building the next pivot table. Begin by creating the basic skeleton framework for the pivot table. (You may want to switch over to the Classic Layout View, but that is also an optional step that you dont have to complete if you prefer working with the Modern Excel 2007 Layout). At this stage, do not add any fields to the pivot table. After having created the basic skeleton layout of the pivot table, it is now time to add fields to the pivot table. o Drag Store Square Feet into the Drop Row Fields Here position OR the Drop Column Fields Here position.
12
Drag Total Dollars Purchased into the Drop Data Items Here position or into the Values position area.
The resulting pivot table should appear. Additional work needs to be done before the pivot table is considered to be complete. Please make the following changes: o Change the summary operator from sum to average. o Change the Custom Name to Average Dollars Purchased o Using the currency format, format all dollar amounts to display with the $ sign, commas and no decimal places. o Right-align the Total so that it is directly over the numbers. Your completed pivot table should match the sample. Rename this current worksheet so that its new name is Average by Square Feet. After renaming the sheet, save your work. Make a printout of your results. Label your printout as Printout #5: Average Dollars Purchased by Store Square Feet. After making the printout, navigate to Sheet1 and place the cursor in cell B5. By now, you should begin to see the potential usage of pivot tables and how they can be used to conduct data analysis. Obviously, having an understanding of the data fields themselves is vital as well. If you dont understand your data, then it will be difficult to conduct an effective analysis. Final Data Analysis Exercise Your final data analysis task is to analyze the total dollar amount purchased, the average dollar amount purchased, the average years as a customer and the average number of purchases made, by storage square feet and the category of Pro Shop vs Retail Store. While this might seem daunting at first, the pivot table that you will create is not very difficult to envision since you will simply extend skills that you have already learned and developed. This particular pivot table will have a row field, a column field and four data fields. Therefore, after examining the final problem statement, you should visualize a pivot table comprised of the following: Store Square Feet will occupy the row fields position in the pivot table. The category of Pro Shop vs Retail Store will occupy the column fields position in the pivot table. Dollar Amount Purchased will occupy the data items position in the pivot table. Average Dollar Amount Purchased will also occupy the data items position in the pivot table. Average Years as a Customer will also occupy the data items position in the pivot table. Average Number of Purchases Made will also occupy the data items position in the pivot table. Notice that four data points will be the data items. Begin by creating the basic skeleton framework for the pivot table. (You may want to switch over to the Classic Layout View, but that is also an optional step that you dont have to complete if you prefer working 13
with the Modern Excel 2007 Layout). At this stage, do not add any fields to the pivot table. After having created the basic skeleton layout of the pivot table, it is now time to add fields to the pivot table. o Drag Store Square Feet into the Drop Row Fields Here position or into the Row Labels position. o Drag Pro Shop vs Retail Store into the Drop Column Fields Here position or into the Column Labels position. o Drag Total Dollars Purchased into the Drop Data Items Here position or into the Values position area. o Drag Total Dollars Purchased into the Drop Data Items Here/Values position a second time. o Drag Years as a Customer into the Drop Data Items Here/Values position. o Drag Number of Purchases Made into the Drop Data Items Here/Values position. Just like one of our prior pivot tables, the resulting pivot table appears strung out and is hard to read. Notice all of the data points are being summed, and several of them need to be averages. Both of those will be details that are fixed in the next few steps. As you did previously, click on the cell in the table containing the word Values. From within that cell, rightclick the mouse, select Move Values to and then Move Values to Rows in order to move the four data items into the rows position, similar to what is seen in the picture. Select one of the cells where the label Sum of TOTAL DOLLARS PURCHASED appears. Use the Value Fields Settings dialog box to change the Custom Name to Total Amount Purchased. Select one of the cells where the label Sum of TOTAL DOLLARS PURCHASED2 appears. Use the Value Fields Settings dialog box to change the summary operator to Average. Then, change the Custom Name to Average Amount Purchased. The two remaining fields in the pivot table are labeled as Sum of YEARS AS A CUSTOMER and Sum of NUMBER OF PURCHASES MADE. The summary value operator for both of those items needs to be switched to the average operator, and then appropriate changes to the label should be made as well. Select one of the cells where the label Sum of YEARS AS A CUSTOMER appears. Use the Value Fields Settings dialog box to change the summary operator to Average. Then, change the Custom Name to Average Years as a Customer.
14
Select one of the cells where the label Sum of NUMBER OF PURCHASES MADE appears. Use the Value Fields Settings dialog box to change the summary operator to Average. Then, change the Custom Name to Average Number of Purchases Made. The picture that follows shows the result after making the above changes to the summary operator and custom name for each of the fields. Additional work still needs to be done to format the pivot table so that it has a professional appearance and it is easier to read and interpret. Please make the following formatting changes: o Use the Currency format so that the Total Amount Purchased and Average Amount Purchased displays with the $ sign, commas and no decimal places. o Use the General Number format so that the Average Years as a Customer and Average Number of Purchases Made displays with one decimal place. o Right-align the column labels of Pro Shop, Retail Store and Grand Total. o Narrow each of the columns to approximately match the pivot table that follows. The four-factor pivot table that you have now completed can be used to perform your final data analysis task. However, you feel that you might be able to better understand the data if you filtered the data based upon region. All you need to do is add a report filter/page field to the pivot table. Drag Region into the Drop Page Fields Here position or into the Report Filter position area. When Region appears in one of those two locations, it also appears in the other location as well. When the filter is first added to the pivot table, all of the data is displayed, just as it did prior to the filter being added. As part of your analysis, you want to answer the question of which region has the largest grand total for total amount purchased? (when Pro Shop and Retail Store data is combined) Click the drop-down option to the right of All. Select each of the regions, noting the figure in the Grand Total column for Total Amount Purchased. Your goal is to determine which region has the largest grand 15
total for total amount purchased. Once you have determined which region has the largest grand total for total amount purchased, display the data using that particular filter. Rename this current worksheet so that its new name is Filtered Four Factor Table. After renaming the sheet, save your work. Hopefully, your printout matches the pivot table seen below (both the actual pivot table and a final view of the Excel screen is shown). Make a printout of your results. Label your printout as Printout #6: Filtered Four Factor Table.
16
Pivot tables that you created previously in this tutorial use the Report Filter or a Page Field to filter data found in a pivot table. Beginning with Excel 2010, a new feature called a slicer was introduced. Slicers provide a quick and easy way to filter a pivot table, either by a single filed or multiple fields. You can create a slicer for any field in your pivot table. Every slicer consists of an object that contains a button for each unique value in that field. You can even create more than one slicer at a time. Slicers are just like the traditional filters seen earlier, but probably easier to create. Unlike the traditional filter, you can: Filter on multiple values for the same field. For instance, you might look at data from both the North region and South region at the same time. Filter on multiple fields. For instance, you might filter on the Sale Rep field, the Region field and the Customer field (all at the same time). For this next pivot table, lets switch worksheets and use the worksheet called Data4Slicer. Click somewhere in the data on the worksheet called Data4Slicer. Create a pivot table that sums sales by sales rep and region. As is seen below, right-align the labels over the sales figures. Format the sales figures to display as currency with 2 decimal places.
This pivot table shows the sales for each sales rep, as well as the sales for each region. You can also see various combinations of sales for each rep by region. Interesting stuff, but perhaps you would like to see this same information filtered by customer. While you can create the traditional filter using a report filter or page field, a slicer might be easier. Lets create a slicer of Customer. Make sure that your cursor is somewhere in the middle of the pivot table. In the Excel toolbar, you should see the PivotTable Tools, Options tab. Click Insert Slicer. Insert Slicers will appear and you can select the slicer or slicers that you would like to insert. Since we would like to filter the data by customer, select Customer, followed by OK. Drag the slicers box/area to the right of the pivot table. 17
Click on Amazon.com and the data is filtered by the customer Amazon.com (grand total of $786, 347.02) The shading that you see on only Amazon.com indicates that field is being used to filter the data. Double click on Google and the data is filtered by the customer Google (grand total of $727,986.02) Click the Clear Filter button (see picture) to remove all filters. You can also filter using more than one customer at the same time. Perhaps you would like to see the sales for the following customers, all at the same time: Amazon.com, Costco and Home Depot. First, click Amazon.com. Then, press the Control key and click Costco. Release the Control key and the combined sales for the two customers should appear (($1,487,787.97). Press the Control key again and then click Home Depot. When you release the Control key, you should see the combined sales for all three customers (see below)
Using the File tab, Print option, do the following: a) Change the page orientation to Landscape b) In terms of Scaling, specify that you want to Fit Sheet on One Page. Rename this current worksheet so that its new name is Customer Slicers. After renaming the sheet, save your work. Your work should match the pivot table seen above. Make a printout of your results. Label your printout as Printout #7: Customer Slicers. Return to the Data4Slicers worksheet. Create a new pivot table on a new worksheet that sums sales by sales rep and region (just like you did earlier: please see that prior picture if needed). Make sure that you right-align the labels over the sales figures. Format the sales figures to display as currency with 2 decimal places. When you made the prior pivot table, you used one field (Customer) are the slicer/filter. You were able to filter on just one Customer and you also filtered one just three customers (Amazon, Costco and Home Depot). In this 18
next pivot table, you are going to create and use four different slicer fields (create filters using 4 different fields, all at the same time. Using your option to Insert Slicer, select the following as slicers: Product, Sales Rep, Region and Customer. Drag the slicer options to the right of your pivot table so that your work matches the following image.
Now, you can filter your pivot table using various combinations of products, regions, customers and sales reps. Click on the Sales Rep Luke. Observe the results. Move to the Customer slicer option. Click Costco. You are filtering by the sales rep Luke and looking at Lukes sales to the customer Costco. The grand total that you see displayed should be $86,579.26
19
Add an additional slicer of North region. Observe the results. Notice that when you filter by Luke, Costco and North (all at the same time), you can also see the various products that Luke sells to Costco in the North region. He sells three different products (LMK Item, XAS Item and XTI Item). Using the Product filter/slicer, click on each of the three different products and note the sales figure for each product. Using your pivot table, display the product that has the largest sales for the following: Sales Rep = Luke and Customer=Costco and Region = North Rename the worksheet so that its new name is LukeCostcoNorth. Format the worksheet so that it prints on 1 page and that it uses the Landscape Orientation. When finished doing that, save your work. Make a printout of your results. Label your printout as Printout #8: LukeCostcoNorth. You have now completed the Conducting Data Analysis Using a Pivot Table tutorial. Throughout this tutorial, you were exposed to many different pivot table features that you can use to better understand the data that you are working with.
20