Introduction to Excel Pivot Tables Kevin Yili Hong Management Information Systems Temple University Objectives • Understand data organization and sources that are appropriate for use with PivotTables • Be able to use basic PivotTable techniques for data exploration • Create custom reports using PivotTables with appropriate formatting 2 Scenario • You just delivered a report of student credit hours by department • “Can I see these numbers summarized by college also?” • Scenario #1: “Sure, when I get back to my office, I will insert rows for each college, write summing formulas, save file and email it back to you.” • Scenario #2: “Lets open the file and dragand-drop it in right now.” 3 What is an Excel Pivot Table? • An interactive worksheet table – Provides a powerful tool for summarizing large amounts of tabular data • Similar to a cross-tabulation table – A pivot table classifies numeric data in a list based on other fields in the list • General purpose: – Quickly summarize data from a worksheet or from an external source – Calculate totals, averages, counts, etc. based on any numeric fields in your table – Generate charts from your pivot tables 4 Pivot Table Advantages • Interactive: easily rearrange them by moving, adding, or deleting fields • Dynamic: results are automatically recalculated whenever fields are added or dropped, or whenever categories are hidden or displayed • Easy to update: “refreshable” if the original worksheet data changes 5 Appropriate Data • Data arranged in a list: – Columns represent fields – Rows represent a record of related data • First row = column label • Columns contain one sort of data – For example, text in one column and numeric values in a separate column • Remove subtotals – You CAN work with subtotals, but use caution • De-normalized database extracts are great for pivoting! 6 Appropriate Data Example • Incomplete records: First Sandra Last Archer Hamilton Paws First Sandra Sandra Hamilton Hamilton October 2006 Last Archer Archer Paws Paws Spelled the same Gender Semester F Fall 1999 Fall 2005 M Spring 2003 Summer 2005 Gender F F M M Semester Fall 1999 Fall 2005 Spring 2003 Summer 2005 Major Credit Hours Statistics 15 Industrial Engineering 6 Philosophy 12 Chemistry 12 Major Credit Hours Statistics 15 Industrial Engineering 6 Philosophy 12 Chemistry 12 "Introduction to Excel PivotTables", Presented by: S.Archer & R.Armacost University of Central Florida 7 Appropriate Data Example • Mixed use columns : Credit Hours 16 College Science Department Faculty Statistics Ima Faculty YTD Expenses: $4,000 Humanities History Hesa Prof YTD Expenses: $3,500 12 Humanities Art Salvador Dali YTD Expenses: $2,000 24 College Science Humanities Humanities October 2006 Department Statistics History Art Faculty Ima Faculty Hesa Prof Salvador Dali Column Label Credit YTD Hours Expenses 16 $4,000 12 $3,500 24 $2,000 "Introduction to Excel PivotTables", Presented by: S.Archer & R.Armacost University of Central Florida 8 Appropriate Data Example • Column label issues: College Department Faculty Science Statistics Ima Faculty Humanities History Hesa Prof Humanities Art Salvador Dali College Department Faculty Science Statistics Ima Faculty Humanities History Hesa Prof Humanities Art Salvador Dali YTD Expenses 2004 2005 $4,000 $5,000 $3,500 $4,500 $2,000 $3,000 YTD Expense 2004 $4,000 $3,500 $2,000 YTD Expense 2005 $5,000 $4,500 $3,000 2006 $6,000 $5,500 $0 YTD Expense 2006 $6,000 $5,500 Student Credit Hours 2004 2005 2006 16 19 22 12 15 18 24 21 0 Student Student Student Credit Credit Credit Hours Hours Hours 2004 2005 2006 16 19 22 12 15 18 24 21 Zero or Blank? 9 Potential Uses • Ad hoc reporting with “refreshable” summary table reports • Data validation and checking • Web reporting • Data exploration 10