Chapter 35. Analyzing Data with Pivot Tables

<feature><title>In This Chapter</title> </feature>

The previous chapter was an introduction to pivot tables. I presented several examples to demonstrate the types of pivot table summaries that you can generate from a set of data.

This chapter continues the discussion and explores the details of creating effective pivot tables. Creating a basic pivot table is very easy, and the examples in this chapter demonstrate additional pivot table features that you may find helpful. I urge you to try these techniques with your own data. If you don’t have suitable data, use the files on the companion CD-ROM.

Working with Non-Numeric Data

Most pivot tables are created from numeric data, but pivot tables are also useful with some types of non-numeric data. Because you can’t sum non-numbers, this technique involves counting.

Figure 35.1 shows a table and a pivot table generated from the table. The table is a list of 400 employees, along with their location and gender. As you can see, the table has no numeric values, but you can create a useful pivot table that counts the items rather than sums them. The pivot table cross-tabulates the Location field by the Sex field for the 400 employees and shows the count for each combination of location and gender.

This table doesn’t have any numeric fields, but you can use it to generate a pivot table, shown next to the table.

Figure 35.1. This table doesn’t have any numeric fields, but you can use it to generate a pivot table, shown next to the table.

On the CD-ROM

A workbook that demonstrates a pivot table created from nonnumeric data is available on the companion CD-ROM. The file is named employee list.xlsx.

Following are the settings I used for this pivot table:

  • The Sex field is used for the Column Labels.

  • The Location field is used for the Row Labels.

  • Location is used for the Values and is summarized by Count (specified in the Data Field Settings dialog box).

  • The pivot table has the field headers turned off (by choosing PivotTable Tools On the CD-ROM Options On the CD-ROM Show/Hide On the CD-ROM Show Field headers).

Note

The Employee file is not used. This example uses the Location field for the Values section, but you can actually use any of the three fields because the pivot table is displaying a count.

Figure 35.2 shows the pivot table after making some additional changes:

  • I added a second instance of the Location field to the Values section and used the Data Field Settings dialog box to display the values as Pct. Of Column.

  • I changed the field names in the pivot table to Count and Pct.

  • I selected a Pivot Table Style that uses Banded Columns, which makes it easier to distinguish the count columns from the percent columns.

The pivot table, after making a few changes.

Figure 35.2. The pivot table, after making a few changes.

Grouping Pivot Table Items

One of the most useful features of a pivot table is the ability to combine items into groups. You can group items that appear as Row Labels or Column Labels. Excel offers two ways to group items:

  • Manually: After creating the pivot table, select the items to be grouped and then choose PivotTable Tools Manually: Options Manually: Group Manually: Group Selection. Or, you can right-click and choose Group from the shortcut menu.

  • Automatically: If the items are numeric (or dates), use the Grouping dialog box to specify how you would like to group the items. Select any item in the Row Labels or Column Labels and then choose PivotTable Tools Automatically: Options Automatically: Group Automatically: Group Selection. Or, you can right-click and choose Group from the shortcut menu. In either case, Excel displays its Grouping dialog box.

A manual grouping example

Figure 35.3 shows the pivot table example from the previous sections, with two groups created from the Row Labels. To create the first group, I held the Ctrl key while I selected Arizona, California, and Washington. Then I right-clicked and chose Group from the shortcut menu. I repeated the operation to create the second group. Then I replaced the default group names (Group 1 and Group 2) with more meaningful names (Eastern Region and Western Region).

A pivot table with two groups.

Figure 35.3. A pivot table with two groups.

You can create any number of groups and even create groups of groups.

Viewing grouped data

Excel provides a number of options for displaying a pivot table, and you may want to experiment with these options when you use groups. These commands are on the PivotTable Tools Viewing grouped data Design tab of the Ribbon. There are no rules for these options. The key is to try a few and see which makes your pivot table look the best. In addition, try various PivotTable Styles, with options for banded rows or banded columns. Often, the style that you choose can greatly enhance readability.

Figure 35.4 shows pivot tables using various options for displaying subtotals, grand totals, and styles.

Pivot tables with options for subtotals and grand totals.

Figure 35.4. Pivot tables with options for subtotals and grand totals.

Automatic grouping examples

When a field contains numbers, dates, or times, Excel can create groups automatically. The two examples in this section demonstrate automatic grouping.

Grouping by date

Figure 35.5 shows a portion of a simple table with two fields: Date and Sales. This table has 730 rows and covers the dates between January 1, 2005, and December 31, 2006. The goal is to summarize the sales information by month.

You can use a pivot table to summarize the sales data by month.

Figure 35.5. You can use a pivot table to summarize the sales data by month.

On the CD-ROM

A workbook demonstrating how to group pivot table items by date is available on the companion CD-ROM. The file is named sales by date.xlsx.

Figure 35.6 shows part of a pivot table created from the data. The Date field is in the Row Labels section and the Sales field is in the Values section. Not surprisingly, the pivot table looks exactly like the input data because the dates have not been grouped.

The pivot table, before grouping by month.

Figure 35.6. The pivot table, before grouping by month.

To group the items by month, select any date and choose PivotTable Tools The pivot table, before grouping by month. Options The pivot table, before grouping by month. Group The pivot table, before grouping by month. Group Field (or, right-click and choose Group from the shortcut menu). You see the Grouping dialog box, shown in Figure 35.7.

Use the Grouping dialog box to group pivot table items by dates.

Figure 35.7. Use the Grouping dialog box to group pivot table items by dates.

In the By list box, select Months and Years and verify that the starting and ending dates are correct. Click OK. The Date items in the pivot table are grouped by years and by months, as shown in Figure 35.8.

The pivot table, after grouping by month and year.

Figure 35.8. The pivot table, after grouping by month and year.

Note

If you select only Months in the Grouping list box, months in different years combine together. For example, the January item would display sales for both 2005 and 2006.

Figure 35.9 shows another view of the data, grouped by quarter and by year.

This pivot table shows sales by quarter and by year.

Figure 35.9. This pivot table shows sales by quarter and by year.

Grouping by time

Figure 35.10 shows a set of data in columns A:B. Each row is a reading from an instrument, taken at one-minute intervals throughout an entire day. The table has 1,440 rows, each representing one minute. The pivot table summarizes the data by hour.

This pivot table is grouped by Hours.

Figure 35.10. This pivot table is grouped by Hours.

On the CD-ROM

This workbook, named hourly readings.xlsx, is available on the companion CD-ROM.

Following are the settings I used for this pivot table:

  • The values area has three instances of the Reading field. I used the Data Field Setting dialog box (Summarize By tab) to summarize the first instance by Average, the second instance by Min, and the third instance by Max.

  • The Time field is in the Row Labels section, and I used the Grouping dialog box to group by Hours.

Creating a Frequency Distribution

Excel provides a number of ways to create a frequency distribution (see Chapter 14). But none of these methods is easier than using a pivot table.

Figure 35.11 shows part of a table of 221 students and the test score for each. The goal is to determine how many students are in each 10-point range (1–10, 11–20, and so on).

Creating a frequency distribution for these test scores is simple.

Figure 35.11. Creating a frequency distribution for these test scores is simple.

On the CD-ROM

This workbook, named test scores.xlsx, is available on the companion CD-ROM.

The pivot table is simple:

  • The Score field is in the Row Labels section (grouped).

  • Another instance of the Score field is in the Values section (summarized by Count).

The Grouping dialog box that generated the bins specified that the groups start at 1, end at 100, and are incremented by 10.

Note

By default, Excel does not display items with a zero value. In this example, no test scores are below 21, so the 1–10 and 11–20 items are hidden. To override this setting, access the PivotTable Options dialog box, click the Display tab, and put a check mark next to Display Item Labels When No Fields Are In The Values Area.

Figure 35.12 show the frequency distribution of the test scores, along with a pivot chart. (See “Creating Pivot Charts,” later in this chapter).

The pivot table and pivot chart shows the frequency distribution for the test scores.

Figure 35.12. The pivot table and pivot chart shows the frequency distribution for the test scores.

Note

This example used Excel’s Grouping dialog box to create the groups automatically. If you don’t want to group in equal-sized bins, you can create your own groups. For example, you may want to assign letter grades based on the test score. Select the rows for the first group and then choose Group from the shortcut menu. Repeat these steps for each additional group. Then replace the default group names with more meaningful names.

Creating a Calculated Field or Calculated Item

Perhaps the most confusing aspect of pivot tables is calculated fields versus calculated items. Many pivot table users simply avoid dealing with calculated fields and items. However, these features can be useful, and they really aren’t that complicated once you understand how they work.

First, some basic definitions:

  • A calculated field: A new field created from other fields in the pivot table. If your pivot table source is a worksheet table, an alternative to using a calculated field is to add a new column to the table, and create a formula to perform the desired calculation. A calculated field must reside in the Values area of the pivot table. You can’t use a calculated field in the Column Labels, Row Labels, or in a Report Filter.

  • A calculated item: A calculated item uses the contents of other items within a field of the pivot table. If your pivot table source is a worksheet table, an alternative to using a calculated item is to insert one or more rows and write formulas that use values in other rows. A calculated item must reside in the Column Labels, Row Labels, or Report Filter area of a pivot table. You can’t use a calculated item in the Values area.

The formulas used to create calculated fields and calculated items aren’t standard Excel formulas. In other words, you don’t enter the formulas into cells. Rather, you enter these formulas in a dialog box, and they’re stored along with the pivot table data.

The examples in this section use the worksheet table shown in Figure 35.13. The table consists of five fields and 48 rows. Each row describes monthly sales information for a particular sales representative. For example, Amy is a sales rep for the North region, and she sold 239 units in January for total sales of $23,040.

This data demonstrates calculated fields and calculated items.

Figure 35.13. This data demonstrates calculated fields and calculated items.

On the CD-ROM

A workbook demonstrating calculated fields and items is available on the companion CD-ROM. The file is named calculated fields and items.xlsx.

Figure 35.14 shows a pivot table created from the data. This pivot table shows Sales (Values area), cross-tabulated by Month (Row Labels) and by SalesRep (Column Labels).

This pivot table was created from the sales data.

Figure 35.14. This pivot table was created from the sales data.

The examples that follow create

  • A calculated field, to compute average sales per unit

  • Four calculated items, to compute the quarterly sales commission

Creating a calculated field

Because a pivot table is a special type of range, you can’t insert new rows or columns within the pivot table, which means that you can’t insert formulas to perform calculations with the data in a pivot table. However, you can create calculated fields for a pivot table. A calculated field consists of a calculation that can involve other fields.

A calculated field is basically a way to display new information in a pivot table. It essentially presents an alternative to creating a new column field in your source data. In many cases, you may find it easier to insert a new column in the source range with a formula that performs the desired calculation. A calculated field is most useful when the data comes from a source that you can’t easily manipulate—such as an external database.

In the sales example, for example, suppose that you want to calculate the average sales amount per unit. You can compute this value by dividing the Sales field by the Units Sold field. The result shows a new field (a calculated field) for the pivot table.

Use the following procedure to create a calculated field that consists of the Sales field divided by the Units Sold field:

  1. Select any cell within the pivot table.

  2. Choose PivotTable Tools Creating a calculated field Options Creating a calculated field Tools Creating a calculated field Formulas Creating a calculated field Calculated Field. Excel displays the Insert Calculated Field dialog box.

  3. Enter a descriptive name in the Name box and specify the formula in the Formula box (see Figure 35.15). The formula can use worksheet functions and other fields from the data source. For this example, the calculated field name is Avg Unit Price, and the formula is

    =Sales/'Units Sold'
    The Insert Calculated Field dialog box.

    Figure 35.15. The Insert Calculated Field dialog box.

  4. Click Add to add this new field.

  5. Click OK to close the Insert Calculated Field dialog box.

Note

You can create the formula manually by typing it or by double-clicking items in the Fields list box. Double-clicking an item transfers it to the Formula field. Because the Units Sold field contains a space, Excel adds single quotes around the field name.

After you create the calculated field, Excel adds it to the Values area of the pivot table (and it also appears in the PivotTable Field List). You can treat it just like any other field, with one exception: You can’t move it to the Row Labels, Column Labels, or Report Filter areas. It must remain in the Values area.

Figure 35.16 shows the pivot table after adding the calculated field. The new field displayed Sum of Avg Unit Price, but I changed this label to Avg Price. I also changed the style to display banded columns.

This pivot table uses a calculated field.

Figure 35.16. This pivot table uses a calculated field.

Tip

The formulas that you develop can also use worksheet functions, but the functions can’t refer to cells or named ranges.

Inserting a calculated item

The preceding section describes how to create a calculated field. Excel also enables you to create a calculated item for a pivot table field. Keep in mind that a calculated field can be an alternative to adding a new field to your data source. A calculated item, on the other hand, is an alternative to adding a new row to the data source—a row that contains a formula that refers to other rows.

In this example, you create four calculated items. Each item represents the commission earned on the quarter’s sales, according to the following schedule:

  • Quarter 1: 10% of January, February, and March sales

  • Quarter 2: 11% of April, May, and June sales

  • Quarter 3: 12% of July, August, and September sales

  • Quarter 4: 12.5% of October, November, and December sales

Note

Modifying the source data to obtain this information would require inserting 16 new rows, each with formulas. So, for this example, creating four calculated items may be an easier task.

To create a calculated item to compute the commission for January, February, and March, follow these steps:

  1. Move the cell pointer to the Row Labels or Column Labels area of the pivot table and choose PivotTable Tools Note Options Note Tools Note Formulas Note Calculated Item. Excel displays the Insert Calculated Item dialog box.

  2. Enter a name for the new item in the Name box and specify the formula in the Formula box (see Figure 35.17). The formula can use items in other fields, but it can’t use worksheet functions. For this example, the new item is named Qtr1 Commission, and the formula appears as follows:

    =10%*(Jan+Feb+Mar)
    The Insert Calculated Item dialog box.

    Figure 35.17. The Insert Calculated Item dialog box.

  3. Click Add.

  4. Repeat Steps 2 and 3 to create three additional calculated items:

    • Qtr2 Commission: = 11%*(Apr+May+Jun)

    • Qtr3 Commission: = 12%*(Jul+Aug+Sep)

    • Qtr4 Commission: = 12.5%*(Oct+Nov+Dec)

  5. Click OK to close the dialog box.

Note

Note that a calculated item, unlike a calculated field, does not appear in the PivotTable Field List. Only fields appear in the field list.

Caution

If you use a calculated item in your pivot table, you may need to turn off the Grand Total display for columns to avoid double counting. In this example the Grand Total includes the calculated items, so the commission amounts are included with the sales amounts. To turn off Grand Totals, choose PivotTable Tools Caution Design Caution Layout Caution Grand Totals.

After you create the calculated items, they appear in the pivot table. Figure 35.18 shows the pivot table after adding the four calculated items. Notice that the calculated items are added to the end of the Month items. You can rearrange the items by selecting the cell and dragging its border. Another option is to create two groups: One for the sales numbers and one for the commission calculations. Figure 35.19 shows the pivot table after creating the two groups and adding subtotals.

This pivot table uses calculated items for quarterly totals.

Figure 35.18. This pivot table uses calculated items for quarterly totals.

The pivot table, after creating two groups and adding subtotals.

Figure 35.19. The pivot table, after creating two groups and adding subtotals.

Referencing Cells within a Pivot Table

In some cases, you may want to create a formula that references one or more cells within a pivot table. Figure 35.20 shows a simple pivot table that displays income and expense information for three years. In this pivot table, the Month field is hidden, so the pivot table shows the year totals.

The formulas in column F reference cells in the pivot table.

Figure 35.20. The formulas in column F reference cells in the pivot table.

On the CD-ROM

This workbook, named income and expenses.xlsx, is available on the companion CD-ROM.

Column F contains formulas and this column is not part of the pivot table. These formulas calculate the expense-to-income ratio for each year. I created these formulas by pointing to the cells. You may expect to see this formula in cell F5:

=D5/C5

In fact, the formula in cell F5 is

=GETPIVOTDATA("Sum of Expenses",$A$3,"Year",2004)/GETPIVOTDATA("Sum of
Income",$A$3,"Year",2004)

When you use the pointing technique to create a formula that references a cell in a pivot table, Excel replaces those simple cell references with a much more complicated GETPIVOTDATA function. If you type the cell references manually (rather than pointing to them), Excel does not use the GETPIVOTDATA function.

The reason? Using the GETPIVOTDATA function helps ensure that the formula will continue to reference the intended cells if the pivot table changed. Figure 35.21 shows the pivot table after expanding the years to show the month detail. As you can see, the formulas in column F still show the correct result, even though the references cells are in a different location. Had I used simple cell references, the formula would return incorrect results after expanding the years.

After expanding the pivot table, formulas that use the GETPIVOTDATA function continue to display the correct result.

Figure 35.21. After expanding the pivot table, formulas that use the GETPIVOTDATA function continue to display the correct result.

Caution

Using the GETPIVOTDATA function has one caveat: the data that it retrieves must be visible. If you modify the pivot table so that the value returned by GETPIVOTDATA is no longer visible, the formula returns an error.

Tip

If, for some reason, you want to prevent Excel from using the GETPIVOTDATA function when you point to pivot table cells when creating a formula, access the Excel Options dialog box, select the Formulas tab, and remove the check mark from Use GETPIVOTDATA Function For PivotTable References.

Creating Pivot Charts

A pivot chart is a graphical representation of a data summary displayed in a pivot table. A pivot chart is always based on a pivot table. Although Excel lets you create a pivot table and a pivot chart at the same time, you can’t create a pivot chart without a pivot table.

If you’re familiar with creating charts in Excel, you’ll have no problem creating and customizing pivot charts. All of Excel’s charting features are available in a pivot chart.

Cross-Ref

I cover charting in Chapters 19 and 20.

Excel provides two ways to create a pivot chart:

  • Select any cell in an existing pivot table and choose PivotTable Tools Cross-Ref Options Cross-Ref Tools Cross-Ref Pivot Chart.

  • Choose Insert Cross-Ref Tables Cross-Ref Pivot Table Cross-Ref Pivot Chart. Excel creates a pivot table and a pivot chart.

Note

If you’ve used pivot charts in a previous version of Excel—and were frustrated by their limitations—you’ll be pleased to know that pivot charts are improved significantly in Excel 2007.

A pivot chart example

Figure 35.22 shows part of a table that tracks daily sales by region. The Date field contains dates for the entire year (excluding weekends), the Region field contains the region name (Eastern, Southern, or Western), and the Sales field contains the sales amount.

This data will be used to create a pivot chart.

Figure 35.22. This data will be used to create a pivot chart.

On the CD-ROM

This workbook, named sales by region.xlsx, is available on the companion CD-ROM.

The first step is to create a pivot table to summarize the data. Figure 35.23 shows the pivot table. The Date field is in the Row Labels area, and the daily dates have been grouped into months. The Region field is in the Column Labels area. The Sales field is in the Values area.

This pivot table summarizes sales by region and by month.

Figure 35.23. This pivot table summarizes sales by region and by month.

The pivot table is certainly easier to interpret than the raw data, but the trends would be easier to spot in a chart.

To create a pivot chart, select any cell in the pivot table and choose PivotTable Tools This pivot table summarizes sales by region and by month. Options This pivot table summarizes sales by region and by month. Tools This pivot table summarizes sales by region and by month. Pivot Chart. Excel displays its Create Chart dialog box, from which you can choose a chart type. For this example, select a standard line chart and click OK. Excel creates the pivot chart and also displays the PivotChart Filter pane, shown in Figure 35.24.

The pivot chart uses the data displayed in the pivot table.

Figure 35.24. The pivot chart uses the data displayed in the pivot table.

The chart makes it easy to see an upward sales trend for the Western division, a downward trend for the Southern division, and relatively flat sales for the Eastern division.

When you select a pivot chart, the Ribbon displays a new tab: PivotChart Tools. The commands are virtually identical to those for a standard Excel chart, so you can manipulate the pivot chart any way you like.

If you modify the underlying pivot table, the chart adjusts automatically to display the new summary data. Figure 35.25 shows the pivot chart after I changed the Date grouping to quarters.

If you modify the pivot table, the pivot chart is also changed.

Figure 35.25. If you modify the pivot table, the pivot chart is also changed.

More about pivot charts

Following are a few points to keep in mind when using pivot charts:

  • A pivot table and a pivot chart are joined in a two-way link. If you make structural or filtering changes to one, the other is also changed.

  • The PivotChart Filter Pane, which is displayed when you select a pivot chart, contains the same controls as the pivot chart’s field headers. These controls allow you to filter the data that’s displayed in the pivot table (and pivot chart). If you make changes to the chart using the PivotChart Filter Pane, those changes are also reflected in the pivot table.

  • If you find the PivotChart Filter Pane redundant or annoying, just click the X in its title bar to make it go away. To bring it back, choose PivotChart Tools More about pivot charts Analyze More about pivot charts Show/Hide More about pivot charts PivotChart Filter.

  • If you have a pivot chart and you delete the underlying pivot table, the pivot chart remains. The chart’s Series formulas contain the original data, stored in arrays.

  • By default, pivot charts are embedded in the sheet that contains the pivot table. To move the pivot chart to a different worksheet (or to a Chart sheet), choose PivotChart More about pivot charts Tools More about pivot charts Design More about pivot charts Location More about pivot charts Move Chart.

  • You can create multiple pivot charts from a pivot table, and you can manipulate and format the charts separately. However, all the charts display the same data.

  • Don’t forget about themes. You can choose Page Layout More about pivot charts Themes More about pivot charts Themes to change the workbook theme, and your pivot table and pivot chart will both reflect the new theme.

Another Pivot Table Example

The pivot table example in this section demonstrates some useful ways to work with pivot tables.

Figure 35.26 shows a table with 3,144 data rows, one for each county in the U.S. The fields are

  • County: The name of the county

  • State Name: The state of the county

  • Region: The region (Roman number ranging from I to XII)

  • Census 2000: The population of the county, according to the 2000 Census

  • Census 1990: The population of the county, according to the 1990 Census

  • Land Area: The area, in square miles (excluding water-covered area)

  • Water Area: The area, in square miles, covered by water

This table contains data for each county in the U.S.

Figure 35.26. This table contains data for each county in the U.S.

On the CD-ROM

This workbook, named county data.xlsx, is available on the companion CD-ROM.

Figure 35.27 shows a pivot table created from the county data. The pivot table uses the Region and State Name fields for the Row Labels and uses Census 2000 and Census 1990 as the Column Labels.

This pivot table was created from the county data.

Figure 35.27. This pivot table was created from the county data.

I created three calculated fields to display additional information:

  • Change (displayed as Pop Change): The difference between Census 2000 and Census 1990

  • Pct Change (displayed as Pct Pop Change): The population change expressed as a percentage of the 1990 population

  • Density (displayed as Pop/Sq Mile): The population per square mile of land.

A new feature in Excel 2007 lets you document your calculated fields and calculated items. Choose PivotTable Tools This pivot table was created from the county data. Options This pivot table was created from the county data. Tools This pivot table was created from the county data. Formulas This pivot table was created from the county data. List Formulas, and Excel inserts a new worksheet with information about your calculated fields and items. Figure 35.28 shows an example.

This worksheet lists calculated fields and items for the pivot table.

Figure 35.28. This worksheet lists calculated fields and items for the pivot table.

This pivot table is sorted on two columns. The main sort is by Region, and states within each region are sorted alphabetically. To sort, just select a cell that contains a data point to be included in the sort. Right-click and choose from the shortcut menu.

Sorting by Region requires some additional effort because Roman numerals are not in alphabetical order. Therefore, I had to create a custom list. To create a custom sort list, access the Excel Options dialog box, click the Personalize tab, and click Edit Custom Lists. Click New List, type your list entries, and click Add. Figure 35.29 shows the custom list I created for the region names.

This custom list ensures that the Region names are sorted correctly.

Figure 35.29. This custom list ensures that the Region names are sorted correctly.

Producing a Report with a Pivot Table

By using a pivot table, you can convert a huge table of data into an attractive printed report. Figure 35.30 shows a small portion of a pivot table that I created from a table that has 25,664 rows of data. This data happens to be my digital music collection, and each row contains information about a single music file: The genre, the artist name, the album, the file name, the file size, and the duration.

A 119-page pivot table report.

Figure 35.30. A 119-page pivot table report.

The pivot table report created from this data is 119 pages long, and it took about five minutes to set up (and a little longer to fine-tune it).

On the CD-ROM

This workbook, named music list .xlsx, is available on the companion CD-ROM.

Here’s a quick summary of how I created this report:

  1. I selected a cell in the table and chose Insert On the CD-ROM Tables On the CD-ROM PivotTable.

  2. In the Create PivotTable dialog box, I clicked OK to accept the default settings.

  3. In the new worksheet, I used the PivotTable Field List and dragged the following fields to the Row Labels area: Genre, Artist, and Album.

  4. I dragged these fields to the Values area: Song, Size, and Duration.

  5. I used the Data Field Settings dialog box to summarize Song as Count, Size as Sum, and Duration as Sum.

  6. I wanted the information in the Size column to display in megabytes, so I formatted the column using this custom number format:

    ###,###, "Mb";;
  7. I wanted the information in the Duration column to display as hours, minutes, and seconds, so I formatted the column using this custom number format:

    [h]:mm:ss;;
  8. I edited the column headings. For example, I replaced “Count of Song” with No. Songs.

  9. I changed the layout to outline format by choosing PivotTable Tools On the CD-ROM Design On the CD-ROM Layout On the CD-ROM Report Layout.

  10. I turned off the field headers by choosing PivotTable Tools On the CD-ROM Options On the CD-ROM Show/Hide On the CD-ROM Show Field Headers.

  11. I turned off the buttons by choosing PivotTable Tools On the CD-ROM Options On the CD-ROM Show/Hide On the CD-ROM +/-Buttons.

  12. I displayed a blank row after each artist by choosing PivotTable Tools On the CD-ROM Design On the CD-ROM Layout On the CD-ROM Blank Rows.

  13. I applied a built-in style by choosing PivotTable Tools On the CD-ROM Design On the CD-ROM PivotTable Styles.

  14. I increased the font size for the Genre.

  15. I went into Page Layout View, and I adjusted the column widths so that the report would fit horizontally on the page.

Note

Step 14 was actually kind of tricky. I wanted to increase the size of the genre names, but leave the subtotals in the same font size. Therefore, I couldn’t modify the style for the PivotTable Style I chose. I selected the entire column A and pressed Ctrl+G to bring up the Go To dialog box. I clicked Special to display the Go To Special dialog box. Then I selected the Constants option and clicked OK, which selected only the nonempty cells in column A. I then adjusted the font size for the selected cells.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset