Excel PivotTables Basics and Beyond



Similar documents
Enhance The Excel Experience Part I

Analyzing Excel Data Using Pivot Tables

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Produced by Flinders University Centre for Educational ICT. PivotTables Excel 2010

Pastel Evolution BIC. Getting Started Guide

Getting Started Guide SAGE ACCPAC INTELLIGENCE

Getting Started Guide

Microsoft Excel 2007 Consolidate Data & Analyze with Pivot Table Windows XP

Microsoft Excel 2010 Pivot Tables

EXCEL PIVOT TABLE David Geffen School of Medicine, UCLA Dean s Office Oct 2002

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

A Beginning Guide to the Excel 2007 Pivot Table

3 What s New in Excel 2007

STATEMENT OF TRANSACTION REPORT ANALYSIS USING EXCEL

About PivotTable reports

Microsoft Access 2010 handout

Sample- for evaluation purposes only! Advanced Excel. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

Excel Database Management Microsoft Excel 2003

Computer Training Centre University College Cork. Excel 2013 Pivot Tables

A Quick Tour of F9 1

Getting Started with Excel Table of Contents

Advanced Excel 10/20/2011 1

Create an Excel BI report and share on SharePoint 2013

Access 2007 Creating Forms Table of Contents

Excel 2003 Tutorial I

Monthly Payroll to Finance Reconciliation Report: Access and Instructions

Microsoft Excel 2010 Part 3: Advanced Excel

Excel Using Pivot Tables

IRA Pivot Table Review and Using Analyze to Modify Reports. For help,

Overview What is a PivotTable? Benefits

Excel Working with Data Lists

Sage Intelligence Report Designer Add-In

Create a PivotTable or PivotChart report

Module One: Getting Started Opening Outlook Setting Up Outlook for the First Time Understanding the Interface...

Search help. More on Office.com: images templates. Here are some basic tasks that you can do in Microsoft Excel 2010.

Using Delphi Data with Excel and Access

MICROSOFT EXCEL 2010 ANALYZE DATA

Basic Pivot Tables. To begin your pivot table, choose Data, Pivot Table and Pivot Chart Report. 1 of 18

Excel Using Pivot Tables

Excel 2010: Create your first spreadsheet

Advanced Microsoft Excel 2010

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

To reuse a template that you ve recently used, click Recent Templates, click the template that you want, and then click Create.

MS Excel: Analysing Data using Pivot Tables

EXCEL Using Excel for Data Query & Management. Information Technology. MS Office Excel 2007 Users Guide. IT Training & Development

Scott Harvey, Registrar Tri County Technical College. Using Excel Pivot Tables to Analyze Student Data

Microsoft Excel: Pivot Tables

Microsoft Access 2010 Part 1: Introduction to Access

EXCEL FINANCIAL USES

BID2WIN Workshop. Advanced Report Writing

MODULE 7: FINANCIAL REPORTING AND ANALYSIS

Excel 2007 Basic knowledge

How To Create A Report In Excel

Using Excel as a Management Reporting Tool with your Minotaur Data. Exercise 1 Customer Item Profitability Reporting Tool for Management

Tommy B. Harrington 104 Azalea Drive Greenville, NC

Introduction to Microsoft Access 2003

Excel 2003 PivotTables Summarizing, Analyzing, and Presenting Your Data

Microsoft Excel 2010 Tutorial

Microsoft Office Access 2007 Basics

ACADEMIC TECHNOLOGY SUPPORT

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Microsoft Using an Existing Database Amarillo College Revision Date: July 30, 2008

Creating Reports with Smart View s Ad Hoc Analysis

BAT Smart View for Budget Users. Miami-Dade County. BAT Smart View Training Activity Guide

Crystal Reports Payroll Exercise

Microsoft Access Basics

Business Objects Version 5 : Introduction

HRS 750: UDW+ Ad Hoc Reports Training 2015 Version 1.1

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

MICROSOFT ACCESS 2003 TUTORIAL

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

How to Excel with CUFS Part 2 Excel 2010

Task Force on Technology / EXCEL

Business Intelligence Getting Started Guide

To complete this workbook, you will need the following file:

Word 2007: Basics Learning Guide

Analyzing Data Using Excel

Basic Microsoft Excel 2007

CHAPTER 6: ANALYZE MICROSOFT DYNAMICS NAV 5.0 DATA IN MICROSOFT EXCEL

MICROSOFT OFFICE ACCESS NEW FEATURES

History Explorer. View and Export Logged Print Job Information WHITE PAPER

Excel for Data Cleaning and Management

Participant Guide RP301: Ad Hoc Business Intelligence Reporting

Using an Access Database

BUSINESS DATA ANALYSIS WITH PIVOTTABLES

Outlook . User Guide IS TRAINING CENTER. 833 Chestnut St, Suite 600. Philadelphia, PA

Microsoft Excel 2007 Mini Skills Overview of Tables

Basic Excel Handbook

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

Kingsoft Spreadsheet 2012

Creating and Using Databases with Microsoft Access

Excel What you will do:

Microsoft Query, the helper application included with Microsoft Office, allows

Search help. More on Office.com: images templates

Excel Integrated Reporting

An Introduction to Excel Pivot Tables

BusinessObjects: General Report Writing for Version 5

Web Intelligence User Guide

warpct.com Working with MS Excel 2003 Workbook courseware by WARP! Computer Training

Tips and Tricks SAGE ACCPAC INTELLIGENCE

Transcription:

Excel PivotTables Basics and Beyond Improving Productivity with Excel s Most Powerful Feature L. A. McClelland K2 Enterprises

Introduction to PivotTables PivotTables are the most powerful feature of Excel, yet few accountants use them in their day-to-day activities. For some, PivotTables are too intimidating; for others, PivotTables are unknown. PivotTables may be challenging at first, but with a little instruction and guidance, they will become part of your regular repertoire for analysis and reporting. Our coverage will begin with basic PivotTables and progress to advanced PivotTable topics. Topics covered in this chapter will include creating simple PivotTable reports, rearranging reports in the PivotTable task pane, grouping and custom grouping, ungrouping, drill down to underlying details, and custom data summaries. What is a PivotTable? A PivotTable report is an interactive table that automatically extracts, organizes, and summarizes data. A PivotTable report can be used to analyze data for example, to make comparisons, to detect patterns and relationships, or to uncover trends. PivotTables are extremely useful for summarizing and analyzing large amounts of data efficiently and effectively. For example, a CFO may need to quickly summarize fifty thousand sales transactions to produce quarterly totals by product line within sales region. Alternatively, a public practitioner evaluating audit risk may need to summarize all of a client's bill payment checks by vendor and by quarter. In both examples, users would like to be able to drill on the summarized totals in the report to see the detailed transactions that underlie the totals. PivotTables can provide all of this functionality and more, quickly and with computational accuracy. Excel uses specific terms to identify the elements of a PivotTable report. The main elements, shown in Figure 1 on the following page, are row fields, column fields, report filters, values fields, items, and the data area. 1

1 2 3 4 5 6 Figure 1 Parts of a PivotTable Report Filters Values Fields Column Fields Items Row Fields Data Area Row Fields are fields from the source data that are assigned to a row layout in a PivotTable. Region and Product are row fields in Figure 1. Column Fields are fields from the source data that are assigned to a column layout. Quarter is a column field in Figure 1. Report Filters are fields from the source data that act as filters in a PivotTable report. Years is a report field in Figure 1. The Years field could be used to display data from a single year, such as 2011, or multiple years, such as 2011 and 2012, etc. 2

Items are the subcategories of a row, column, or report filter. In this example, the Region field contains these items: East and West. The Product field contains these items: Pipe, 1/2-inch, Galv; and Pipe, 1/2-inch, Sch 40, etc. Values Fields are fields from the source data that contain values to be summarized. Sales is a values field in Figure 1, on the previous page. For numeric data, users can choose how to summarize the data (sum, average, count). For text data, users can count the number of times a specific text entry, such as Yes or No, appears in a field. The Data Area is the range of cells in a PivotTable report that contains summarized data. For example, the value in cell C5 summarizes sales for the product Pipe, 1/2- inch, Galv, for the East region in the first quarter of 2012. In other words, cell C5 provides a summary of the sales figures for every row in the source data that contains the items Pipe, 1/2-inch, Galv, East, Qtr1, and 2003. Now that we understand what a PivotTable is and are familiar with the terminology used by Microsoft to describe the various elements of a PivotTable, let s begin our coverage of PivotTables. Simple PivotTables A large portion of the productivity and information analysis benefits of using PivotTables is gained with the simplest of PivotTables. In other words, you need not be a PivotTable expert or know how to apply the advanced features of PivotTables in order to take advantage of their power and functionality. The Law of Diminishing Returns applies! As our PivotTables become more complex, the amount of learning required to take advantage of their more complex functionality increases. For most analyses, a simple PivotTable that auto-summarizes or auto-tabulates our data will be very effective and will provide all of the power that we need. The table of data in Figure 2, on the following page, contains sales data extracted from a general ledger. It will serve as the data source for our initial PivotTable examples. Each record represents the total sales by month for a specific product. There are three columns of data Month, Product, and Sales. The sales figures could be in units, thousands of units, dollars, or thousands of dollars, etc. In this case, we will assume that sales are reported in dollars. In our sample data set, there are nearly one hundred rows of data, although many data sets may have thousands of rows. The latest version of Excel supports over one million rows in the worksheet grid, so it is possible to have extremely large data sets as the basis for PivotTables. There are no limits on the amount of data that can be used in a PivotTable, but the more data there is to summarize or analyze, the greater the power of PivotTables. 3

Figure 2 Data for Simple PivotTable Examples In our first example, we would like to tabulate the sales figures by Product and by Month of sale. Our completed PivotTable will have rows for the Product and Months for the columns. To create a simple PivotTable from our data, do the following. 1. Place the cursor in the data and choose PivotTable, PivotTable from the Insert tab, as shown in Figure 3. Figure 3 Select PivotTable from the Insert Tab 2. In the resulting Create PivotTable dialog box, shown in Figure 4 on the following page, the data range should already be defined. If not, click the 4

Collapse Dialog button and highlight the data range. Make sure that your entire data range is selected, including the field names at the top of the data columns. Select New Worksheet and then click OK. Note that a Table can serve as a dynamic data range for a PivotTable in the latest version of Excel. Figure 4 Highlight the Data Range and Select New Worksheet 3. A new worksheet, like the one shown in Figure 5, on the following page, will be inserted in the workbook. On the left side of the worksheet is a placeholder for the PivotTable report to be created. On the right side is the PivotTable Task Pane. The layout of the task pane can be customized to a user's needs by clicking the drop-down button in the top right corner of the task pane just below the title bar. The task pane contains the PivotTable Field List at the top and four quadrant boxes into which fields are dragged from the list to create the PivotTable. The quadrants correspond to the four areas of a PivotTable report: Report Filters, Column Labels (column fields), Row Labels (row fields), and Values (data area). Experienced PivotTable users will recognize Report Filters as Page Fields in earlier versions of Excel. Report Filters are just a new, more descriptive, name for existing functionality. Report Filters serve the same function and work exactly as Page Fields. 5

Figure 5 Creating a PivotTable by Dragging Fields to the Quadrants 4. Now, drag each of the fields, in turn, from the field list at the top of the PivotTable Task Pane to the report quadrants at the bottom, as shown in Figure 5. 6

5. Click on the Month field, hold down your left mouse button and drag and point to the Column Labels quadrant, and then release your left mouse button. 6. Click on the Product field, hold down your left mouse button and drag and point to the Row Labels quadrant, and again release your left mouse button. 7. Click on the Sales field, hold down your left mouse button and drag and point to the Values quadrant, and then release your left mouse button. We have just created our first PivotTable. Figure 6 shows the results of our efforts. Note that some of the monthly columns have been removed from the Pivot-Table for presentation. The table summarizes the raw data into a two-dimensional table with Months across the top and Products down the left margin. Also note how Excel totaled each row and column automatically. Figure 6 Simple PivotTable Report Created with a Few Clicks Creating a PivotTable in the PivotTable Task Pane is only available in the latest version of Excel. In earlier versions, fields were dragged from the Field List to a PivotTable report template to create a report. For experienced users who prefer to use the former method, a setting can be changed in pivot table options to allow the method. Right-click on an existing PivotTable or PivotTable placeholder and select PivotTable Options. In the PivotTable Options dialog box, select Classic PivotTable Layout on the Display tab. This setting can also be modified from the PivotTable Tools contextual tab. 7

Since the simplest of PivotTable reports provide a significant proportion of the power of PivotTables, let's investigate a few report formatting techniques before we examine more powerful features. First, turn off the field headers in the report for presentation. Click Field Headers on the PivotTable Tools, Options tab, to turn off the headers, as shown in Figure 7. Next, rename the Sum of Sales label by typing the desired label into the cell. Simply click in the cell containing the label Sum of Sales and enter Monthly Sales by Product. Figure 7 Hiding the Field Headers and Entering a Descriptive Label for Presentation Cells in a PivotTable can be formatted for printing and display just as with any other cell or range of cells. In our example PivotTable, the sales values in the report need to be formatted in the Accounting format with zero decimals and without dollar signs. The first and total rows of the sales values need to be formatted with dollar signs for presentation. Excel also has a large number of built-in visual styles with which to format PivotTables automatically. These styles, available in the PivotTables Styles gallery 8

on the PivotTable Tools, Design contextual tab, contain a wide variety of colors and formatting for the table, table headers, and total and subtotal rows. Figure 8 shows our PivotTable report with the values formatted as dollars and one of the built-in styles applied. Figure 8 PivotTable with Accounting Format and Style Applied Subtotals and grand totals can be added or removed, as well as row and column banding (which use shading so that data points in rows or columns are easily identified), using buttons and check boxes accessible on the PivotTable Tools, Design contextual tab. Excel also provides three built-in report layouts Compact, Outline, and Tabular that alter the way the report is displayed. The Compact form, which is the default, displays multiple row fields in a single expandable and collapsible column. Field names are hidden on the report. The Tabular form is the familiar PivotTable layout that experienced users have been using for years. Multiple row fields are displayed in multiple columns and the worksheet grid is visible. The Outline form is similar to the Tabular form, but the worksheet grid is not visible in the report. All of the layouts are available from the PivotTable Tools, Design contextual tab Grouping and Ungrouping Data Now, let s examine some of the power of PivotTables. To calculate and display quarterly sales totals for each of the products, simply group the months into quarters. Position the cursor in a cell containing one of the monthly column headings, such as Jan-2012. Right-click, and choose Group to open the Grouping dialog box. In the By box, click Quarters, so that Months and Quarters are highlighted, as shown in Figure 9 on the following page. Click OK to complete the task. 9

Figure 9 Grouping Months into Quarters Turn off the field headers for presentation. On the PivotTable Tools, Options contextual tab, click on Field Headers. Next, position the cursor in a cell containing one of the quarterly column headings, such as Qtr1. Right-click on the cell and from the context-sensitive menu, select Subtotal "Quarters" to add a quarterly subtotal for each quarter. The initial results are shown in Figure 10. Some of the columns have been removed for presentation. Figure 10 Results of Grouping Months into Quarters Again, position the cursor in a cell containing one of the quarterly column headings, such as Qtr1. Right-click on the cell and from the context-sensitive menu, select 10

Expand/Collapse, Collapse Entire Field. Months are collapsed into Quarters, and all of the totals now reflect quarterly totals as shown in Figure 11. Detail can be shown or hidden for a single group or an entire field from the context-sensitive menu. Figure 11 Monthly Data Grouped into Quarters To see the detail observations that underlie any of the cells, just double-click on the cell of interest. Excel will insert a new sheet containing the detail observations that created the cell contents. For example, if a user clicked on cell E9 in our sample PivotTable, containing a sales total of 34,260, Excel would display the underlying detail as shown in Figure 12. Note that the data is presented in Table form and format, which makes it easy to filter and analyze. Figure 12 Drilling to Detail from a PivotTable Custom Groups In the example PivotTable, data items were summarized using built-in groups, such as when months were grouped into quarters. However, Excel allows data to be grouped 11

using user-defined groups. To accomplish this task, first highlight the items to be grouped together. Then, right-click and select Group from the context-sensitive menu. In the example PivotTable, we would like to group the products into one of three product lines Iron, Plastic, and Copper. The galvanized pipe products make up the Iron group, the schedule 40 products make up the Plastic group, and the tubing products make up the Copper group. Click on product Pipe, Galv, 1-inch, hold down the CTRL key and then select Pipe, Galv, 2-inch and Pipe, Galv, 3-inch. Next, rightclick and choose Group from the context sensitive menu. This combines the first three products into a single group. Rename the Group1 label to Iron to complete the first group, as shown in Figure 13. Highlight the galvanized pipe products. Then Group the items. Rename the group by typing Iron in the cell that contains the Group1 label. Repeat the process for the other groups. Figure 13 Grouping Products into Product Groups Repeat the steps for each of the two remaining groups, Plastic and Copper. To complete the PivotTable, add subtotals for each of the product groups. Position the cursor in a cell containing one of the group row headings, such as Iron. Right-click on 12

the cell and from the context-sensitive menu, select Subtotal "Product2" to add a subtotal for each product group. The completed report should resemble the one shown in Figure 14. Figure 14 PivotTable with Product Groups and Subtotals Note that the default field name, Product2, given by Excel to the product group can be renamed in Field Settings. Right-click on any one of the group labels and select Field Settings from the context-sensitive menu. In the Field Settings dialog box, type in the desired field name, such as Product Group, in the Custom Name box and click OK. Also note that the default Compact layout puts group subtotals at the top of the group on the same line with the group name. If subtotals are desired at the bottom of each group, select Subtotals, Show All Subtotals at Bottom of Group on the PivotTable Tools, Design contextual tab. Alternatively, right-click on any one of the group labels and select Field Settings. In the Field Settings dialog box, on the Layout & Print tab, uncheck Display subtotals at the top of each group, and click OK. Any items within a field may be custom grouped to form another field. Custom grouping may also be necessary when built-in groups are not consistent with a 13

company's practices. For example, when months are grouped into quarters, the built-in groups use a calendar year to define the quarters. If a company uses a fiscal year other than a calendar year, custom grouping of months into quarters will be necessary. Pivoting Columns and Rows The summarized table can be rearranged, or pivoted, to show the data from any perspective. Along with the ability to group or ungroup data, being able to immediately rearrange the table is among the most powerful features of PivotTables. For example, if users wanted to display Products as the columns and Quarterly Totals as the rows, they would simply rearrange the rows and columns by dragging and dropping the fields in the quadrant boxes. Continuing with our example PivotTable, follow along with your instructor as we demonstrate the ease of rearranging a PivotTable report. 1. Position the cursor in the PivotTable report to display the PivotTable Task Pane. In the field list at the top of the task pane, uncheck Month and Product Group to remove them from the report. Click on Quarters and drag it into the Row Labels quadrant and drop it below Product. This has the effect of reporting Quarters within Products, as shown in Figure 15. Figure 15 Dragging Fields in the PivotTable Task Pane to Rearrange a Report 2. Now, click on Quarters and drag-and-drop it into the Column Labels quadrant. This rearranges the report so that Products are the columns and Quarters are the rows, as shown in Figure 16 on the following page. 14

Figure 16 Completing the Drag-and-Drop Rearrangement of a Report To review, we are simply dragging the field buttons to different quadrants in the PivotTable Task Pane in order to rearrange the report. We can view a report with Month and/or Quarters across the columns and Products as the rows, or Products as the columns and Months and/or Quarters as the rows, Months within Products, or Products within Months, etc. The number of ways that we can view a PivotTable is limited only by the number of fields that we have to display and our imagination. At first glance, the power of PivotTables to reduce the time and tedium of preparing routine reports is significant. However, the real power of PivotTables is not clerical; it is the added ability they provide to view data from different perspectives. By viewing data from different perspectives, PivotTables increase the probability of uncovering relationships in the data that were previously unknown and of exploiting these relationships on behalf of our company or our clients. Now, that's analytical power! Using Field Settings In our PivotTable examples above, the individual data elements were summed to produce the report. By changing field settings, we can display the average sales in 15

each cell, or the minimum or maximum sales, or the variance or standard deviation of the sales distribution, etc. Field Settings are accessible in any of several ways: 1) Right-click on a field label and select Field Settings or Value Field Settings from the context-sensitive menu, 2) Position the cursor in a cell containing a field label or value and select Field Settings from the PivotTable Tools, Options contextual tab, or 3) Click the drop-down arrow of any field button in a quadrant box on the PivotTable Task Pane and select Field Settings or Value Field Settings from the menu. To change the summary function for any value field, open the Value Field Settings dialog box using any of the described methods. In the Summarize value field by box, select the function to use in summarizing the field's values. To summarize the selected field by calculating averages, select Average, as shown in Figure 17. Figure 17 Changing the Summary Function for a Value Field In the next example, a PivotTable report that displays four columns, one each for the total annual sales by product, the average sales by product, and the minimum and maximum sales by product will be created. Since the statistics are calculated on sales data, the sales field must be dragged to the Values quadrant four times, once for each summary column to be displayed. The Field Settings (field name and summary function) for each field are then modified, in turn, to reflect the appropriate calculation. Figure 18, on the following page, illustrates this process and the finished report. Follow along with your instructor as we explore multi-column reports and field settings. 16

Figure 18 Creating a Multi-Column PivotTable to Display Sales Statistics Let's add another column to our report. In this final example, the CFO would like to have a column that displays the sales of each product as a percentage of total sales. 17

Since the column is to summarize sales data, the Sales field must be dragged to the Values quadrant area once again, a fifth time. Right-click on its column heading and select Value Field Settings. Click on the Show values as tab, and in the Show values as drop-down list, select % of column and click OK. Type in Percent as the new column heading, drag the new Percent column just to the left and adjacent to the Totals column, and then adjust the column widths to complete the PivotTable report, as shown in Figure 19. Figure 19 Using Percentage of Column to Display Sales as a Percentage of Total Sales 18

Sorting and Filtering Fields The latest version of Excel provides enhanced context-sensitive sorting and filtering of PivotTable fields. All of the sorting and filtering capabilities are easily accessible in the Field List at the top of the PivotTable Task Pane. Click the drop-down arrow in any field button and select the appropriate sort or filter options, as shown in Figure 20. Figure 20 Sorting or Filtering PivotTable Fields Updating the Underlying Data Whenever data is changed, updated, or added to the underlying data table, a user must refresh the PivotTable to see the changes reflected in the report. Position the cursor anywhere in the table, and then right-click and choose Refresh from the contextsensitive menu. Alternatively, click the Refresh button on the PivotTable Tools, Options contextual tab. Note that it is best practice to always refresh a PivotTable after re-arranging a complex report. If data is added or removed from the data range and the size of the range changes, then users may have to modify the data range. If the data range is an Excel table, no action 19

is necessary. A table is a dynamic range that re-adjusts its dimensions automatically as data is added or removed. Similarly, if the data range is a named dynamic range, no action is necessary. (Tables and named dynamic ranges are discussed in chapter two.) But, if the data range is an ordinary range specified using cell references, the data range must be adjusted. To adjust the data range, position the cursor in the PivotTable report. On the PivotTable Tools, Options contextual tab, click Change Data Source. In the Change PivotTable Data Source dialog box, re-specify the data range and click OK. The existing PivotTable will be updated to reflect the new data. Using Drag-and-Drop to Create a PivotTable In earlier versions of Excel, PivotTables were created by dragging fields from the field list to the PivotTable report template. Experienced users of PivotTables are likely to find the drag-and-drop method preferable to using the PivotTable Task Pane. To enable drag-and-drop PivotTable creation and modification, position the cursor inside the PivotTable placeholder or an existing PivotTable. Right-click and select PivotTable Options to open the PivotTable Options dialog box. Alternatively, click Options on the PivotTable Tools, Options contextual tab. On the Display tab, select Classic PivotTable layout (enables dragging of fields in the grid), as shown in Figure 21. Figure 21 Enabling Drag-and-Drop Creation of PivotTables 20

Follow along with your instructor as we create a PivotTable using the classic dragand-drop method. Either the Tabular or Outline report layout form can be used with the Classic PivotTable layout. The Classic PivotTable layout uses the Tabular report form in default. If a user selects the Compact report form, drag-and-drop is disabled, even though the classic blue outlines remain around the PivotTable drop areas when the table is active. Tables as Dynamic Data Ranges The latest version of Excel contains much improved list functionality that is referred to as Tables. A table is nothing more than a list of data in which each column has a heading or field name and each row represents a record. The table features in Excel are designed to ease and enhance the way users sort, filter, format, and analyze information in tables. Here are some of the built-in features for managing and manipulating tables: Auto Expansion Tables expand automatically to include new data entered in adjacent rows or columns. All styles, calculations, data validation, and conditional formats are applied to extensions. Sorting Users can sort on unlimited columns and on font or fill colors. Sorts can be made case sensitive. Filtering Users can filter on single or multiple criteria, icon sets, and on dynamic dates, such as last week or last month. Formula Replication Any formula created in an adjacent column to make calculations on table data is automatically replicated across all rows. Duplicate Data Users can highlight or remove duplicate rows with a few simple commands. Table Styles A large gallery of table styles is available for automatically formatting tables. Styles with banded rows auto-adjust the color bands for record additions, deletions, sorting, and filtering. Styles interact with Themes to provide greater flexibility in formatting tables. Structured Referencing Formulas that reference elements of a table can use row and column tags rather than cell references in the formula for clarity and ease of use. 21

Think of a table as a two-dimensional Excel database with special functionality. The most important functionality, from the perspective of using tables as data sources for PivotTables, is the first feature listed in the bulleted list. Tables auto-expand to include data entered or copied in rows or columns immediately adjacent to an existing table. This functionality allows tables to function as dynamic data ranges for PivotTables. As new data is generated or acquired, users need only paste the new data to the bottom of the table and them refresh any dependent PivotTables to update their reports. To create a table, position the cursor inside of the data and then select Format as Table from the Home tab. Choose a style from the gallery and then confirm the table range in the Create Table dialog box. Click OK to create the table. To create a PivotTable report using a table as the data source, position the cursor inside of the table. From the Insert tab, click PivotTable, PivotTable. In the Create PivotTable dialog box, the name of the table should already be entered in the Table/Range box, as shown in Figure 22 on the following page. If not, simply type in the name of the table and click OK. Complete the PivotTable report as desired. Figure 22 Specifying a Table as a PivotTable Data Source Whenever new data becomes available, paste the data in the first blank row immediately adjacent to the bottom of the table and then Refresh the PivotTable to update the report. If old data needs to be replaced completely, highlight and delete the existing data in the table, and then resize the table. On the Table Tools, Design contextual tab, click Resize Table and then specify the range reference necessary to contract the table to its minimum size of two rows. Copy the new data into the table 22

and it will automatically expand to include all pasted rows. Refresh any dependent PivotTables to update the reports Consolidation PivotTables Consolidation PivotTables are used to report data that is already tabulated. For example, if a user wanted to combine divisional or departmental income statements, or product line, business line, or channel profitability reports, consolidation PivotTables can be used to produce the combined reports. The only requirement is that the data layout of the individual worksheets to be consolidated is similar, but they need not be identical. Consolidation PivotTables are not available from the ribbon. Users must add the PivotTable and PivotChart Wizard to the Quick Access Toolbar (QAT) to access this functionality. Follow along with your instructor as we add the wizard to the QAT. In the following example, product line income statements will be combined into a single report with all of the reporting flexibility of a PivotTable. A sample of the data, which has an identical table for each of three product lines, is shown in Figure 23. Figure 23 Data to be Summarized Using a Consolidation PivotTable Simple Consolidating PivotTables In the first dialog box of the PivotTable Wizard, make sure to select Multiple consolidation ranges. Click Next. Then, select how the Page fields are to be created. To insure maximum reporting flexibility, choose I will create the page fields and then click Next. The dialog box for the next step in the wizard appears, as shown in Figure 24. Now, each of the data ranges in the single page field to be created must be defined, one range for each of the three product lines Creams, Lotions, and Scrubs. In our example, all of the ranges to be consolidated are on separate worksheets in a single workbook, but the data ranges can be consolidated from multiple workbooks. To consolidate ranges from multiple workbooks, simply open the other workbooks 23

and point to the data ranges during the PivotTable creation process. Alternatively, type in the data ranges using the following format: [workbook name] sheet name! range Make sure to include the brackets around the workbook name and the exclamation point between the sheet name and the range specification. Using defined names to define the data ranges in the individual workbooks will make the task easier and less prone to error. Figure 24 The Collapse Dialog Button is Useful when Highlighting Ranges Click on the Collapse Dialog button, shown in Figure 24 at the right end of the Range box, to hide temporarily the dialog box. Then, using the mouse, highlight the range to be included in the report and click on the Collapse Dialog button to re-display the dialog box. Click Add to add the range to the report. In the Field one box, enter the item name. Each of the ranges added in the dialog box will have its own item name in this example, Creams, Lotions, and Scrubs. The completed dialog appears in Figure 25, on the following page. 24

Figure 25 Name Each Field as the Field Range is Added Click Next. Choose to create the PivotTable on a new worksheet and then click Finish. After grouping Months into Quarters and making some minor formatting changes, the initial PivotTable should resemble the one shown in Figure 26. The items in the report are no longer in income statement order but are in alphabetical order. Figure 26 Initial Consolidation PivotTable Created from Product Data Re-Arranging Items Notice that the items in the Row item area, the income statement components, have been rearranged in alphabetical order. Click and drag the edge of each item until the order of the items is in income statement order. Click on an item to be moved and 25

hover the cursor over the top or bottom edge of the cell so that the mouse pointer turns into a compass rose, as shown in Figure 27. Click and hold the left mouse button and drag the item to the desired position in the list and release the mouse button to drop the item in place. Figure 27 Dragging Row Items into the Proper Order Removing Meaningless Totals The Grand Total at the bottom of the report is meaningless because it adds together all of the income statement components. To remove the total, click Grand Totals on the PivotTable Tools, Design contextual tab and select On for Rows Only, as shown in Figure 28. Figure 28 Removing Grand Totals from PivotTable Alternatively, to remove the grand totals, right-click on the face of the PivotTable and select PivotTable Options from the context-sensitive menu. On the Tables & Filters tab, uncheck Show grand totals for columns. 26

The only task remaining is to complete the PivotTable for presentation. Hide the field headings, center the column headings, rename the page field (the report filter) to Product Line, and give the values field a descriptive name, such as Budgeted Income Statements. The completed PivotTable should resemble the one shown in Figure 29. Keep in mind that all of the drag-and-drop PivotTable functionality is available in the consolidated report. Follow along as your instructor modifies the report in order to view the data from different perspectives. Figure 29 Completed PivotTable Creating Calculated Items In our example, all of the data elements were included in the underlying data set. Let s suppose that the Gross Margin, Total Expenses, and Net Income items were not part of the data. In that case, we would need to calculate these items. Creating calculations in PivotTables is a source of frustration for new and experienced PivotTable users. The general rule is that calculations should be made inside a PivotTable. The major issues that are associated with creating calculations within PivotTables are enumerated in the following list. 1. PivotTables are single unitary objects that cannot be modified by inserting or deleting rows or columns. The normal method of inserting blank rows or columns in which to make calculations does not work in PivotTables. As a workaround, you may copy a PivotTable to another worksheet and then work on the copied range just as with any other worksheet. Experienced users employ a triple-paste sequence to get the desired result Paste Values followed by Paste Special, Formats followed by Paste Special, Column widths. 2. Formulas within PivotTables may not reference a cell or range of cells in the worksheet, but may reference other items or fields and can include constants, 27

mathematical operators, and most Excel functions. Excel functions that require a range reference, such as IRR, cannot be used in a calculated item or field. 3. Data cannot be grouped in a PivotTable across a calculated item. In other words, if a PivotTable contains a calculated row item, columns cannot be grouped because the row item spans multiple columns. However, groups can contain calculated fields. 4. Multiple items or fields in the same PivotTable cannot have the same name. A common workaround is to add a space to the end of the desired field or item name. In this example, we will create a calculated item the gross margin from the data within the simple consolidation PivotTable that we just completed. Items are the individual elements within a field. Note that the row field, as shown in Figure 30, already contains an item named Gross Margin. Consequently, our new item will be named GM. To insert a calculated item: Figure 30 Sample Multiple Consolidated Ranges PivotTable 1. Position the cursor anywhere in the row item area. In this case, the row item area contains the row labels for the income statement components. 2. On the PivotTable Tools, Options contextual tab, click Formulas, Calculated Item. Note that you can also calculate fields through this menu sequence, but that will be covered in the next chapter. 3. In the Insert Calculated Item dialog box, enter a name for the new item in the Name box. Type in GM. 28

4. Then build the formula. Position the cursor in the Formula box, click and highlight Revenue in the Items box and then click Insert Item. Next, type in the minus sign (-) and then click and highlight Cost of Sales in the Items box. Click on Insert Item and then click OK to complete the process, as shown in Figure 31. Figure 31 Entering the Formula for a Calculated Item 5. The new item will be inserted at the bottom of the row items. Use the mouse to drag the item to the correct position in the list. Note that the calculated item GM computes the same gross margin as that displayed by the original item Gross Margin. Excel will display an error message if a user attempts to group column fields or items in a PivotTable report that contains calculated row items because grouping is not allowed across calculated items in a PivotTable. To delete a calculated item, click Formulas, Calculated Item on the PivotTable Tools, Options contextual tab to open the Insert Calculated Item dialog box. Use the drop-down list to select the appropriate item in the Name box and then click Delete. 29

Pivoting Non-Identical Data Ranges The tabulated data ranges that are to be combined using a multiple consolidated ranges PivotTable need not be identical. As a practical matter, they should be similar, but, again, there is no requirement that they have the same layout or content. In this example, we will combine several budget worksheets with different accounts and layouts. Combining data during the budget process consumes more than 50% of the total time spent by accounting staff in the budget process. Using PivotTables to make the combination can help reduce the time spent in the process and improve data accuracy while providing additional analytical capabilities. Here is an overview of the characteristics of our sample data. 1. We have budget worksheets from three departments. 2. Two of the departments have identical accounts, but the third has one additional account. This makes the combination process using sum-through formulas cumbersome and error prone because the amounts on each worksheet do not line up properly. We would experience the same problem in situations where departmental managers altered the worksheet layouts or account structure in the budget process. 3. One of the departmental managers inexplicably changed the name of one of her accounts. The departmental budgets are displayed in Figure 32, on the following page. The manager in Product Design has changed the name of one account from Allocated Central IT to Central IT. The budget for Field Testing has an additional account, Outsourced Services, which is not found in the accounts of the other departments. Note that the amounts for each account on each budget are the same within quarters, so that we will be able to see from our example that the formulas are calculating correctly. Further, the differences in the accounts are highlighted with shading. By combining these budgets in a PivotTable, the cumbersome task of summing through sheets that are not identical will be avoided while insuring computational accuracy and providing greater analytical capability. The process of creating the PivotTable is exactly the same as illustrated in the previous example. Follow along with your instructor as we create the PivotTable. The initial PivotTable is displayed in Figure 33, two pages following. 30

Figure 32 Departmental Budgets in this Example Are Not Identical 31

Figure 33 Initial PivotTable Showing All Department Accounts Combined Note that all accounts, including the Outsourced Services account in Field Testing, were combined properly. The account name changed by the manager in Product Design, Central IT, was combined on a separate line. To force the account to combine properly, change the source data for Product Design, so that the account name reads Allocated Central IT, and then Refresh the PivotTable. After performing these modifications, the PivotTable should resemble the one displayed in Figure 34. Figure 34 Modified PivotTable with Allocated Central IT Account Correctly Combined 32

Of course, since we used a PivotTable to make the combination, we have additional analytical capabilities that we would not have had if we had combined the budget data using some other method. Follow along with your instructor as we rearrange the report to analyze and compare the budgetary amounts entered by the managers of each department. PivotTables Connected to External Data In our examples thus far, all of the data that was summarized in a PivotTable was present in the workbook where the PivotTable was created. Under the circumstances, the creation and update of a report will require the extraction of data from the application where the data is stored and maintained, which is usually the general ledger or other business application. Alternatively, we could use the Open DataBase Connectivity (ODBC) capabilities of Excel to extract the data from the general ledger. Once we connect a PivotTable to our general ledger using ODBC, Excel becomes an extraordinarily effective ad hoc reporting engine. What is ODBC? ODBC is a standard database access method developed by the SQL Access group in 1992. With ODBC, it is possible to access data stored in any ODBC-compliant database from within any ODBC-compliant application. ODBC manages this by inserting a middle layer, called an ODBC driver, between the application and the database management system (DBMS) that translates the application s data queries into commands that the DBMS understands. ODBC can be used to provide two-way integration between Excel and the general ledger, although generally ODBC is used only to extract data. ODBC is an open, vendor-neutral interface for database connectivity that provides access to a variety of PC, RISC, and mainframe database systems. The ODBC programming interface permits a developer to build an application without targeting a specific DBMS. Users can add drivers that link their applications to a database management system and then can access their data using conventional SQL query commands. Most accounting software applications support ODBC. If your accounting software supports ODBC, then Excel can access historical data directly in the general ledger without re-keying any data or going through the typical import-export process used by most management accountants. All of the Microsoft Office applications are ODBC compliant. Office comes with ODBC drivers for Access, Excel, dbase, and text files. Windows XP and Windows Vista broaden the ODBC capabilities of Windows applications by adding drivers for SQL Server, Visual FoxPro, Oracle, and Paradox. The Windows ODBC drivers are part of Microsoft Data Access Components (MDAC), the latest version of which can be downloaded from the Microsoft web site. 33

Extracting Data from an External Database Using ODBC, Excel can easily connect to an external database and extract any necessary data. Figure 35 depicts a graphical representation of the data access process. Figure 35 Accessing Data in Excel Using ODBC Direct extraction may not solve all of our problems. In earlier versions of Excel, it was not uncommon for a data extraction to exceed the row or column capacity of Excel. Users were forced to use an intermediary database, such as Access, to store the data temporarily. However, if users extract data directly into a PivotTable and thereby summarize the data in a limited number of rows or columns, the row and column limits of Excel are not exceeded even if the data itself exceeds the limitations. The process of creating a PivotTable from an external database is the same as for any other PivotTable except that users must specify a source database and the database fields that contain the data of interest. If the data source has already been defined in Excel, the PivotTable creation process is simplified. On the Insert tab, select PivotTable, PivotTable. In the Create PivotTable dialog box, select Use an external data source and click Choose Connection. Select an existing data source in the Existing Connection dialog box and click Open. Then, continue the process to create the desired PivotTable. Creating and using data connections is covered in K2 Enterprises' Advanced Excel course. If the data source has not been defined, begin the PivotTable creation process on the Data tab. Click From Other Sources, From Microsoft Query to open the Choose Data Source dialog box. Select the appropriate ODBC data source, and click OK, as shown in Figure 36 on the following page. In the resulting dialog box, select the desired tables and/or fields from the table list. 34

Figure 36 Selecting the External Data Source In this example, we will be using MAS 90 data from the ABC sample company file. After selecting the data source in the dialog box shown in Figure 36, choose a company file and authenticate to MAS 90 by entering a username and password, as shown in Figure 37. The ODBC driver for MAS 90 requires authentication for each use if ODBC security is enabled. Figure 37 MAS 90 Database Authentication 35

ODBC security can be set from within MAS 90 to restrict access to the general ledger data on a user by user basis. When users authenticate themselves to a company file, the users will only have access to the data for which they have been granted specific rights and permissions. Only a MAS 90 administrator can alter the data access rights and permissions of an individual user. In this example, we will be choosing fields from a single table, the customer master file, AR_Customers. Expand the field list by clicking on the plus (+) sign to the left of the table name in the left-hand pane. Then, choose the fields that are to be displayed in the report and click on the (>) button to move them to the right hand pane, as shown below in Figure 38. Select the following fields: CustomerNo, State, SalespersonNo, CurrentBalance, AgingCategory1, AgingCategory2, AgingCategory3, and Aging Category4. Figure 38 Select the Fields for the Report After the required fields are selected, click Next several times. In the Query Wizard - Finish pane, select Return Data to Microsoft Office Excel and click Finish. In the Import Data dialog box, select PivotTable Report, specify the location for the report, and then click OK. Next, drag and drop the fields to the appropriate report quadrants in the PivotTable Task Pane, rename and format the column labels, choose a number format for the data, and complete the PivotTable just as with any other. The major difference is that this PivotTable is dynamically linked to the underlying data in the General Ledger. If users need the same report next week or next month, all they need to do is retrieve the workbook, refresh the PivotTable, and print the updated report. The process to update and print the report takes seconds to complete. Figure 39, on the following page, illustrates the creation of the initial PivotTable. 36

Figure 39 Creating a PivotTable Connected to an External Data Source 37

Our initial PivotTable contains a 30-day aging report, but it does not contain a column for the total outstanding balances owed by our customers. To create a column for the outstanding balances, we will need to create a calculated field. To insert a calculated field, follow the procedure described below. 1. Position the cursor anywhere in the Over 120 column. 2. On the PivotTable Tools, Options contextual tab, click Formulas, Calculated Field. 3. In the Insert Calculated Field dialog box, enter a name for the new item in the Name box. Type in calcbalance. 4. Then build the formula. Position the cursor in the Formula box, click and highlight CurrentBalance in the Fields box and then click Insert Field. Next, type in the plus sign (+) and then click and highlight AgingCategory1 in the Fields box. Again, click on Insert Field. Repeat this process until all fields through AgingCategory4 are summed in the Formula box. Click OK to complete the process, as shown in Figure 40. Figure 40 Entering a Formula for a Calculated Field 5. The new field will be added as a column to the right of the Over 120 column. Rename the field Balance. 38

To complete the table, drag SalespersonNo to the Row Labels quadrant and drag the CustomerNo field to the Report Filter quadrant. The re-configured PivotTable helps users examine and understand the sales and collection performance of their sales staff. Similarly, we could have replaced SalespersonNo in the Row Labels quadrant with State to produce an aging of accounts by state, which could help users manage risk of non-collection in states affected by natural disasters, such as Hurricane Katrina. The completed PivotTable is shown in Figure 41. Figure 41 Aging of Accounts Receivable by Sales Person Remember, our PivotTable is dynamically linked to the underlying data in MAS 90. To use this report in the future, retrieve the workbook and click Refresh to produce an updated report based on the transactions and postings as they exist in MAS 90 at the time of refresh. 39