Advertisement
Tech

Discover How To Calculate Fields In A Pivot Table With This Excel Tutorial

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.

By Mr Excel
Desk Tech
Reading time 2 min read
Word count 229
Windows platform Computing Microsoft excel
Discover How To Calculate Fields In A Pivot Table With This Excel Tutorial
Advertisement
Quick Take

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.

On this page

See all Microsof Excel tips

Strategy:

Advertisement

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

  1. Build a pivot table.

    Advertisement
  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 =

    Advertisement

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

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

    Advertisement
  2. The formula for Average Price is shown in Fig. 984.

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

Advertisement

**

Gotcha:

Advertisement

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.

Summary:

Advertisement

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

Commands Discussed:

Advertisement

PivotTable – Formula – Calculated Field

**

Advertisement

See all Microsoft Excel tips

Images

Fig. 981

Advertisement

Fig. 982

Fig. 983

Advertisement

Fig. 984

Fig. 985

Advertisement
Keep Exploring

More from Tech

Filed under
Windows platform Computing
More topics
Microsoft excel
Advertisement