How to Insert and Edit a Calculated Field in an Excel Pivot Table

Consider the following: a hypothetical biorefinery has a different bioreactors, producing both biofuel and value-added chemicals. The biorefinery uses microorganisms and fermentation routes. The number of times the equipment failed, and the number of times fermentation succeeded are recorded.

Read More: How to Create Pivot Table Data Model in Excel 2013

A picture of the source data is shown below:

Calculated Field, Pivot Table, Data

Pivot Table, Excel

Example 1 – Create a calculated field

  • Select a cell in the Pivot Table to activate Pivot Table Tools, in the Analyze tab.

Calculated Field, Pivot Table

  • Click the drop-down arrow next to Fields, Items, & Sets in Calculations.
  • Select Calculated Field.

How to Insert Calculated Field in Pivot table

Calculated Field, Pivot Table

  •  In the Formula field, enter the formula:

= (‘Times Failed’/ ‘Number of Times Succeeded with the fermentation run’)*100

It will return the failure rate.

Calculated Field, Pivot Table

  • Click Add to see the new calculated field.
  • Click OK.

Calculated Field, Pivot Table

This is the output.

Calculated Field, Pivot Table

  • Go to Field Settings.
  • In Value Field Settings, choose Product.
  • Click OK.

Calculated Field, Pivot Table

  • Go back to Field Settings.

Calculated Field, Pivot Table

  • In the Value Field Settings dialog box, click Number Format.
  • Select Number and set the decimal places to 1.

Calculated Field, Pivot Table

Bioreactors A, H, and E had the highest failure rates.

Example 2 – Create a Calculated Field using the IF Statement

The original dataset was updated: The ‘Microorganism Used’ column was inserted in the source data. Microorganisms are used in the bioreactor to produce biofuel and other products.

Calculated Field, Pivot Table

  • Select a cell in the Pivot Table and right-click to Refresh, and see the updated fields.

Calculated Field, Pivot Table

  • Create a calculated field to find the number of times fermentation succeeded, irrespective of failure. If it succeeded more than 50 times, the growth of the organism reached the optimum level. If it is less than 50, the organism did not survive in the bioreactor.

Read More: How to Create an Average Calculated Field in Excel Pivot Table

  • Name the Calculated Field ‘Survival of the organism’.
  • Use the formula below:

= IF( ‘Number of Times Succeeded with the fermentation Run’>=50,100%,0)

  • Click Add.
  • Click OK.

Pivot Table Calculated Field IF Statement

This is the output.

Calculated Field, Pivot Table

  • Go to Field Settings.

Calculated Field, Pivot Table

  • Choose Number in the Value Field Settings dialog box.

Calculated Field, Pivot Table

  • Click Percentage and choose 0 decimal places.
  • Click OK and then OK again to close both dialog boxes.

Calculated Field, Pivot Table

This is the output: even though the bioreactor A was failing, the organism grew.

Calculated Field, Pivot Table

Read More: Pivot Table Calculated Field for Average in Excel

Problems with the Calculated Field Tools in Excel Pivot Table

If you face problems with Totals in a Calculated Field:

  •  Right-click a cell in the Pivot Table and Choose PivotTable Options.

Calculated Field, Pivot Table

  • In Totals and Filters tab, uncheck Show grand totals for rows and Show grand totals for columns.

Calculated Field, Pivot Table

Incorrect Totals are not displayed.

Calculated Field, Pivot Table

Another common problem is the name of the field.

Calculated Field, Pivot Table

  • In ∑ Values, click  the drop-down arrow next to Product of Reliable Bioreactors on Site.

Calculated Field, Pivot Table

  • Go to Value Field Settings…

Calculated Field, Pivot Table

  • Change the Custom Name in the Value Field Settings: remove “Product” and enter Reliable Bioreactors.

Calculated Field, Pivot Table

  • Click OK.

Calculated Field, Pivot Table

How to Edit a Calculated Field?

Read More: Excel Pivot Table Terminology

  • Select a cell in the Pivot Table.
  • In Calculations, choose Fields, Items & Sets and select Calculated Field.

Calculated Field, Pivot Table

  • Click the drop-down arrow next to Name and select one of the created calculated fields.

Calculated Field, Pivot Table

  •  Here, Survival of the organism.

How to Edit Calculated Field

  • Adjust the formula, enter:

= IF(‘Number of Times Succeeded with the fermentation Run’ >=105,100%,0)

(50 is changed to 105)

  • Click Modify.
  • Click OK.

Calculated Field, Pivot Table

This is the output: Bioreactor A is no longer included in the good growth rate.

Calculated Field, Pivot Table

How to Delete a Calculated Field in a Pivot Table?

  • In the Analyze tab, select Fields, Items & Sets drop-down to display the Calculated Field.

Calculated Field, Pivot Table

  • Click the drop-down arrow next to Name and choose the name of the calculated field you want to delete. Here, Survival of the organism.

Calculated Field, Pivot Table

Calculated Field, Pivot Table

  • Click Delete.
  • Click OK.

How to Delete a Calculated Field in a Pivot Table

Survival of the organism is deleted both in the Calculated Field and in the Pivot Table Fields List.

Calculated Field, Pivot Table

Useful Pivot Table related Links from ExcelDemy

How to Use Pivot Table Data in Excel Formulas

8 Excel Pivot Table Examples – How to Make a PivotTable!

Useful links

Excel Pivot Table Tutorials for Dummies Step by Step

Download Working File

Calculated-Fields-Sample-WorkSheet.xlsx

Get FREE Advanced Excel Exercises with Solutions!
Taryn Nefdt
Taryn Nefdt

Taryn is a Microsoft Certified Professional, who has used Office Applications such as Excel and Access extensively, in her interdisciplinary academic career and work experience. She has a background in biochemistry, Geographical Information Systems (GIS), and biofuels. She enjoys showcasing the functionality of Excel in various disciplines. She has over ten years of experience using Excel and Access to create advanced integrated solutions.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo