Excel 2007 Formulas (Mr. Spreadsheets Bookshelf)

The pivot table example in this section demonstrates some useful ways to work with pivot tables. Figure 18-37 shows a table with 3,144 data rows, one for each county in the United States. The fields are

image from book Figure 18-37: This table contains data for each county in the United States.

On the CD 

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

Figure 18-38 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.

image from book Figure 18-38: This pivot table was created from the county data.

I created three calculated fields to display additional information:

A new feature in Excel 2007 lets you document your calculated fields and calculated items. Choose PivotTable Tools Options Tools Formulas List Formulas, and Excel inserts a new worksheet with information about your calculated fields and items. Figure 18-39 shows an example.

Figure 18-39: 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 required 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 18-40 shows the custom list I created for the region names.

Figure 18-40: This custom list ensures that the Region names are sorted correctly.

Категории