Before you start, decide whether you want a calculated field or a calculated item within a field. Use a calculated field when you want to use the data from another field in your formula. Use a calculated item when you want your formula to use data from one or more specific items within a field.
For calculated items, you can enter different formulas cell by cell. For example, if a calculated item named OrangeCounty has a formula of =Oranges * .25 across all months, you can change the formula to =Oranges *.5 for June, July, and August.
If you have multiple calculated items or formulas, you can adjust the order of calculation.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Calculated Field.
In the Name box, type a name for the field.
In the Formula box, enter the formula for the field.
To use the data from another field in the formula, click the field in the Fields box, and then click Insert Field. For example, to calculate a 15% commission on each value in the Sales field, you could enter = Sales * 15%.
Click Add.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
If items in the field are grouped, on the Analyze tab, in the Group group, click Ungroup.
Click the field where you want to add the calculated item.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Calculated Item.
In the Name box, type a name for the calculated item.
In the Formula box, enter the formula for the item.
To use the data from an item in the formula, click the item in the Items list, and then click Insert Item (the item must be from the same field as the calculated item).
Click Add.
Click a cell for which you want to change the formula.
To change the formula for several cells, hold down CTRL and click the additional cells.
In the formula bar, type the changes to the formula.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Solve Order.
Click a formula, and then click Move Up or Move Down.
Continue until the formulas are in the order that you want them to be calculated.
You can display a list of all the formulas that are used in the current PivotTable.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On theAnalyze tab, in the Calculations group, click Fields, Items, & Sets, and then click List Formulas.
Before you edit a formula, determine whether that formula is in a calculated field or a calculated item. If the formula is in a calculated item, also determine whether the formula is the only one for the calculated item.
For calculated items, you can edit individual formulas for specific cells of a calculated item. For example, if a calculated item named OrangeCalc has a formula of =Oranges * .25 across all months, you can change the formula to =Oranges *.5 for June, July, and August.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click List Formulas.
In the list of formulas, find the formula that you want to change listed under Calculated Field or Calculated Item.
When there are multiple formulas for a calculated item, the default formula that was entered when the item was created has the calculated item name in column B. For additional formulas for a calculated item, column B contains both the calculated item name and the names of intersecting items.
For example, you might have a default formula for a calculated item named MyItem, and another formula for this item identified as MyItem January Sales. In the PivotTable, you would find this formula in the Sales cell for the MyItem row and January column.
Continue by using one of the following editing methods.
Click the PivotTable.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Calculated Field.
In the Name box, select the calculated field for which you want to change the formula.
In the Formula box, edit the formula.
Click Modify.
Click the field that contains the calculated item.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Calculated Item.
In the Name box, select the calculated item.
In the Formula box, edit the formula.
Click Modify.
Click a cell for which you want to change the formula.
To change the formula for several cells, hold down CTRL and click the additional cells.
In the formula bar, type the changes to the formula.
Tip: If you have multiple calculated items or formulas, you can adjust the order of calculation. For more information, see Adjust the order of calculation for multiple calculated items or formulas.
Note: Deleting a PivotTable formula removes it permanently. If you do not want to remove a formula permanently, you can hide the field or item instead by dragging it out of the PivotTable.
Determine whether the formula is in a calculated field or a calculated item.
Calculated fields appear in the PivotTable Field List. Calculated items appear as items within other fields.
Do one of the following:
To delete a calculated field, click anywhere in the PivotTable.
To delete a calculated item, in the PivotTable, click the field that contains the item that you want to delete.
This displays the PivotTable Tools, adding the Analyze and Design tabs.
On the Analyze tab, in the Calculations group, click Fields, Items, & Sets, and then click Calculated Field or Calculated Item.
In the Name box, select the field or item that you want to delete