Pin Me

Microsoft Excel: Calculated Fields In A Pivot Table

written by: Mr Excel•edited by: Tricia Goss•updated: 7/23/2008

Problem: You need to include a calculation in the pivot table that is not in your underlying data. Your data includes Quantity Sold, Revenue, and Cost, as shown in Fig. 980. You would like to report Gross Profit and Average Price.

  • slide 1 of 2

    See all Microsof Excel tips


    You can add a calculated field to a pivot table. Follow these steps.

    1) Build a pivot table.

    2) From the PivotTable toolbar, select PivotTable – Formula – Calculated Field, as shown in Fig. 981.

    3) Type a name for the field, in this case, Profit. Enter the calculation =

    R e v e n u e – COGS. Choose the Add button, as shown in Fig. 982.

    4) Here is the formula for Gross Profit Percent. See Fig. 983.

    5) The formula for Average Price is shown in Fig. 984.

    The resulting pivot table includes all of the fields, as shown in Fig. 985.


    The label Sum of GPPct is somewhat misleading, as is Sum of Average Price. In reality, Excel finds the sum of Revenue, finds the sum of Quantity, and then divides the values on the total line in order to get the average price. This makes calculated fields fine for any calculations that follow the Associative law of mathematics. If you actually wanted to have Excel do all of the individual average prices and then sum them up, it would be impossible in a pivot table.


    Calculated Fields add a new measure that can be reported in the Data area of a PivotTable for all Measures.

    Commands Discussed:

    PivotTable – Formula – Calculated Field


    See all Microsoft Excel tips

  • slide 2 of 2


    Fig. 980Fig. 981Fig. 982Fig. 983Fig. 984Fig. 985