Last updated: July 18, 2008 11:47 PM
![]()
Excel -- Pivot Tables -- Custom Calculations
- % of Column
- % of Row
- % of Total
- Difference from
- % Difference from
- % Of
- Running Total in
- Remove a Custom Calculation
Download the zipped sample file
In a Pivot Table, you can summarize the data by using the values in other cells in the data area.
For example, you can show each Region's total as a percentage of the national total. Or, calculate the difference between the sales totals for the current year, and the sales totals for the previous year. The examples shown here are based on this zipped sample file .
% of Column
In this example, the pivot table has Region in the Row area, and Total in the Data area. A custom calculation will be added, to show the percentage for each region's sales, compared to the national total.
- From the Pivot Table field list, drag another copy of the Total field to the Data area.
- If the data fields are arranged vertically, you can change them to a horizontal layout, by following the instructions here.
- Right-click the heading cell for the new column, and select Field Settings...
- In the Field Settings dialog box, type a name for the field, e.g. %Sales
- Click the Options button, to expand the dialog box
- From the Show data as dropdown list, select % of column
- Click the OK button
In this example, the pivot table has Item in the Row area, Region in the Column area, and Total in the Data area. The total will be changed to a custom calculation, to show the percentage for each region's sales of an item, compared to the item total.
Difference from
In this example, the pivot table has Region in the Row area, and Total in the Data area. Date is in the Column area, grouped by Year. There are instructions here for grouping data.The total will be changed to a custom calculation, to compare the current year's sales for each region, to previous year's sales, in dollars.
- Right-click one of the cells in the Data area, and select Field Settings...
- In the Field Settings dialog box, type a name for the field, e.g. Change
- Click the Options button, to expand the dialog box
- From the Show data as dropdown list, select Difference From
- From the Base field list, choose Years
- From the Base item list, choose (previous)
- Click the OK button
![]()
![]()
% Difference from
In this example, the pivot table has Item in the Row area, and Total in the Data area. Date is in the Column area, grouped by Year. There are instructions here for grouping data.The total will be changed to a custom calculation, to compare the current year's sales for each Item, to previous year's sales, as a percentage.
- Right-click one of the cells in the Data area, and select Field Settings...
- In the Field Settings dialog box, type a name for the field, e.g. %Change
- Click the Options button, to expand the dialog box
- From the Show data as dropdown list, select % Difference From
- From the Base field list, choose Years
- From the Base item list, choose (previous)
- Click the OK button
![]()
![]()
Running Total in
In this example, the pivot table has Region in the Column area, and Total in the Data area. Date is in the Row area, grouped by Year and Quarter. There are instructions here for grouping data.The total will be changed to a custom calculation, to calculate a running total of sales for each Region, over each Year.
- Right-click one of the cells in the Data area, and select Field Settings...
- In the Field Settings dialog box, type a name for the field, e.g. Sales
- Click the Options button, to expand the dialog box
- From the Show data as dropdown list, select Running Total in
- From the Base field list, choose Date
- Click the OK button
![]()