• Excel Book Excerpt

Excel Specify a Number Format for a Pivot Table Field

This page is an advertiser-supported excerpt of the book, Learn Excel 2007-2010 from MrExcel - 512 Excel Mysteries Solved. If you like this topic, please consider buying the entire e-book.

Specify a Number Format
for a Pivot Table Field

Problem: In a pivot table, a Values field tends to appear in a General format. This doesn’t always work for me. I might want thousands separators or even to show numbers in thousands. If I change the number format using the settings in the Home tab of the ribbon, the number format is lost after the next pivot table refresh.

Strategy: Number formatting is controlled from the Field Settings dialog. There are two approaches for displaying Field Settings for the correct field.

  • Use the Active Field group in the Options tab of the ribbon. To use this field, you must select either the Sum of Revenue heading or a cell that contains a revenue amount. The Active Field box will show Sum of Revenue. You can then click Field Settings.

 

LE10000818.jpg

Figure 789 Choose a cell in the pivot table to change the active field.

  • Alternatively, you can go to the Revenue field in the Field List drop zones, open the flyout menu and choose Field Settings. For an image, turn back to Figure 781.

Follow these steps to specify a number format for a pivot table field:

1. Display the Field Settings dialog for the Sum of Revenue field using either of the methods described above. Excel will display the Value Field Settings dialog.

2. Click the Number Format button at the bottom of the dialog.

LE10000819.jpg

Figure 790 Access the number format from here.

3. Excel will display an abbreviated version of the Format Cells dialog with only the Number tab. Choose an appropriate numeric format. You can create custom formats. Click OK to close the Format Cells dialog and then click OK to close the Value Field Settings dialog.

LE10000820.jpg

Figure 791 Apply a number format to the field.

Results: the Revenue field will now always show the selected format, no matter how the pivot table is changed.

LE10000821.jpg

Figure 792 Excel keeps the number format, even after you move fields.

The above method formats all Sum of Revenue cells using the numeric formatting attached to the Sum Revenue field to assign a non-currency format.

Gotcha: One of the conventions in formatting tables says that you should include a currency symbol on only the first and total rows of a data set. There is no inherent way to do this with a pivot table. However, you can use the numeric formatting attached to the Sum of Revenue field to assign a non-currency format. Then you select the first row of cells and assign a currency format by pressing Ctrl+1 to display the Format Cells dialog. This will work initially, but will be lost when you change the table.

<-Previous Topic Next Topic->

For more resources for Microsoft Excel: