BUSINESS DATA ANALYSIS WITH PIVOTTABLES Jim Chen, Ph.D. Professor Norfolk State University 700 Park Avenue Norfolk, VA 23504 (757) 823-2564 jchen@nsu.edu
BUSINESS DATA ANALYSIS WITH PIVOTTABLES INTRODUCTION The primary objective of an accounting system is to "summarize transactional data into useful management reports that management can use to manage the business" (Kieso et al., 2006). A powerful vehicle that helps us to achieve this objective is the Excel PivotTable. It provides us a powerful tool to organize and summarize data, and display the output in different views. Displaying summarized data in different views allows us to make comparisons, explore relationships, and identify trends, i.e., convert data into information. Typical uses of PivotTable are business-data analysis and report generation. Data such as budgets, costs, operating expenses, sales, inventories, etc., are good candidates for PivotTable. Many companies praise PivotTable; for example, Microsoft claims the PivotTable is its primary vehicle for analyzing financial data (Accounting Software Advisor, 2003), and those CPAs who have used the PivotTable indicate it is the most important reporting tool they use (Collins, 2003). Moreover, there is a trend in financial reporting to integrate accounting software data with Excel and other components in Microsoft Office (ASW, 2007). The PivotTable, however, may be one of the least understood and used features in Excel (Montondon & Marsh, 2006). Collins (2003) reported that only approximately 10% CPAs use PivotTable. Most Excel users don t even know it exists (Metz, 2007). In fact, it is straight forward to create a PivotTable report. PivotTable in Excel 2007 is even more accessible and understandable than earlier versions. Having said the importance of financial reporting and the significant underutilization of PivotTable, the purpose of this paper is two fold; one is to demonstrate the ease of creating a PivotTable report, and the other, to illustrate its essential features, i.e., the use of PivotTable to count frequency, perform calculations, sort data, group data, collapse/expand data, and filter data. Instructors teaching accounting information systems or computerized accounting may spend a session on PivotTable. DATA Our sample table contains 1,715 rows of data, and the fields (columns) are Order ID, Order Date, Customer Name, Region, State, Market Segment, Item Category, Item, Unit Price, Number Ordered, and Line Total. To generate a PivotTable report from a table (Tables are called lists in Excel 2003 and earlier versions), the table must meet the following three requirements: 1. Each column has a distinct name, and the column names appear in the first row of the worksheet 2. All values in a column must match the column name 3. There are no empty rows or columns within the range of data used for the report A look at our worksheet indicates that our table satisfies the three requirements. 1
PIVOTTABLES CREATION Count Frequency Before we develop a PivotTable report, determine what we want to know. As we are reviewing a report, other reports may come to mind. Suppose we want to find the number of orders by item category and item. We shall start by clicking any cell in the table, choosing PivotTable from the Insert tab, and pressing the OK button in the Create PivotTable dialog box (Figure 1) to accept the default settings. If a change to the defaults is necessary, simply make the change and then press the OK button. Figure 1 Create PivotTable Dialog Box Excel presents us with a new worksheet that contains the PivotTable Field List and a PivotTable layout area as shown in Figure 2. The field names on the PivotTable Field List are the column names of our table. To generate the report we want, we shall (1) drag the Item Category from the PivotTable Field List to Drop Row Fields Here, (2) drag the Item to Drop Row Fields Here again, and (3) drag the Item again to the Drop Data Items Here. The three steps are shown in Figure 2. Alternatively, we can right-click a field name and select a location to move the field to, or select the check box next to the field name and let Excel decide where to move it to. The results are shown in Figure 3. Count of Item is displayed in Cell A3 because Excel counts the frequency of each different item in the Item column. If a more meaningful name is desired, we can change it. To change the name, we would select Cell A3, type the new name in the formula bar, and press ENTER. 2
Figure 2 Steps for Finding the Number of Orders by Item Category and Item Figure 3 Number of Orders by Item Category and Item 3
Find the Sum In addition to the number of orders, we are also interested in total order amount by item category and item. By default, Excel will count character fields and sum numerical fields placed in the Drop-Data-Items-Here area. Thus, to find the total order amount for each item and item category, all we have to do is dragging Count of Item in Cell A3 out of the pivot table and selecting the check box next to Line Total from the PivotTable Field List. The report is shown in Figure 4. Figure 4 Total Order Amount by Item Category and Item Calculate the Average Excel provides 11 different statistics, from count and sum to standard deviation and variance. To show average sales by item category and item, right click any cell in the data area to display the quick menu, move cursor to Summarize Data By, and select Average as shown in Figure 5. Sort Data Based on Another Field Items names are listed alphabetically in Figure 4. It would make sense to see the item names listed in descending order of total sales. To get what we want, right click any cell containing data in the Total column, move cursor to Sort, and select Sort Largest to Smallest as shown in Figure 6. 4
Figure 5 Quick Menu Showing Summarize Data By Figure 6 Quick Menu Showing Sort 5
Group Data by Dates It comes to our mind that a report showing quarterly sales amount by item category and by item would help the management to cope with seasonality. To add order date to our report, right click any cell in the report to display the quick menu, select Show Field List to enable PivotTable Field List, and choose Order Date. The results are partially shown in Figure 7. To group dates, at first, right click any cell in the Order Date column, and select Group from the quick menu to display the Grouping dialog box (see Figure 8). Then, select Quarters, deselect Months, and click OK to obtain the report we want. Figure 7 PivotTable Field list and Report with Order Date 6
Figure 8 Grouping Dialog Box Collapse/Expand Data We can expand or collapse to any level of data detail in a PivotTable report. For example, the quarterly sales PivotTable report is long and we want each Item Category to be on a separate page. To show only the Technology category, simply click the Collapse buttons ( ) at the left of the Furniture category and the Office Supplies category. The result is shown in Figure 9. After the details for a label is collapsed, its corresponding Collapse button changes to an Expand button ( ). Alternatively, we can double click a label to collapse or expand its details. Frequently we want to see the details for a specific value. For instance, when we review Figure 9, we may be interested in the records that contribute to the sales of notebook computers in quarter 3. To see these contributing records, just either double click D9 or right click D9 and select Show Details. The associated detail data is placed on a new worksheet. To hide the detail data, delete the new worksheet. Figure 9 has four row fields and no column field. It makes sense to move the Order Date field to columns. To do this, right click Order Date (C4) to display the quick menu, place cursor on Move, and click Move Order Date to Columns. Figure 10 displays the new view. 7
Figure 9 Report with Furniture and Office Supplies Category Collapsed Figure 10 Report with Order Dates in Columns Filter Data Another way to see exactly what we want is to filter the report data. To show only the Technology category, (1) click the arrow next to the Item Category field, (2) clear the Select All check box in the list, (3) select the check box next to Technology, and (4) click the OK command button (see Figure 11). Now the PivotTable displays only the data for technology as shown in Figure 12. To indicate this report is filtered, a filter icon appears next to the Item Category field. 8
Figure 11 Filter Check Boxes Figure 12 Report Displaying Technology Category Only 9
PIVOTCHARTS CREATION A PivotChart report provides a graphical representation of the data in a PivotTable. A PivotChart is always associated with a PivotTable. We can automatically create a PivotChart report when we first create a PivotTable report, or we can create a PivotChart report from an existing PivotTable report. To create a clustered column PivotChart report from the PivotTable shown in Figure 12, (1) click anywhere in the PivotTable, (2) select Options tab and click PivotChart in the Tools group, (3) select the Clustered Column, the first chart in the top row, in the Insert Chart dialog box and click the OK button. The PivotChart is displayed on the PivotTable sheet as shown in Figure 13. The PivotChart shows the total sales for the technology items in each quarter. The PivotChart Tools context tab provides four tools tabs we can use to design, lay out, and format a chart as well as analyze our data. To move the chart to a new sheet, (1) select the Design tab, (2) click Move Chart to open the Move Chart dialog box, and (3) click New sheet and name the sheet tab. To change the title of the chart to Total Sales by Quarter and Item, simply double click the existing chart title and change it. To label the Y axis, (1) select the Layout tab, (2) Click Axis Titles and select Primary Vertical Axis Title and Rotated Title, and type Sales Amount. The final PivotChart report is shown in Figure 14. Figure 13 PivotChart 10
Figure 14 PivotChart on New Sheet CONCLUSION A primary objective of any financial system is to provide accurate and timely financial reports. A frequent complaint is that we are not provided with the kind of financial reports we want. Yet, considering the importance of financial reporting, users typically fail to fully utilize the tools they have. Excel is one of the most widely available computer programs, and its PivotTable is one of the most powerful analytical and report generating tools. It can summarize thousands rows of data instantly, generate a concise report, and let us pivot the view with ease. The PivotTable, however, is one of the least used tools. To promote the use of PivotTable to summarize business data into useful management reports, we demonstrate its ease of use and illustrate its essential features in this paper. 11
REFERENCES Accounting Software Advisor, Financial Reporting, http://www.accountingsoftwarenews.com/ charts/reporting.htm, 2003. Collins, J. Carlton, How to Select the Right Accounting Software Part 1, Journal of Accountancy Online, http://www.aicpa.org/pubs/ JOFA/part1.htm. Johnson, Randy, Accounting Software World, Financial Reporting, http://www.accountingsoftwareworld.com/charts/reporting.htm, April 26, 2007 Kieso, Donald E., Jerry J. Weygandt, Terry D. Warfield, Intermediate Accounting, 12 th Ed., John-Wiley & Sons, 2006. Metz, Cade, Innovators Pito Salas, PC Magazine, Vol. 26, No. 12, June 5, 2007, P. 56. Montondon, Lucille G., and Treba L. Marsh, Pivot Tables: A Means to Quick, Accurate Trial Balances, The CPA Journal Online, April 2006, http://www.nysscpa.org/cpajournal/2006/406/ essentials/p68.htm N.B. The sample spreadsheet can be obtained from the author. 12