Open In App

How to Add a Calculated Field to a Pivot Table in Excel

Last Updated : 23 Dec, 2024
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

A Calculated Field in Pivot Table allows you to perform custom calculations within your Excel Pivot Table, giving you more flexibility and deeper insights into your data. Whether you need to add a custom formula, modify existing calculations, or remove a field, this guide walks you through the essential steps. By learning how to add a calculated field to a Pivot Table, you'll unlock the potential for advanced data analysis and customization, helping you make informed decisions with ease.

How to Add a Calculated Field to a Pivot Table

Adding a calculated field lets you apply a custom formula directly within your Pivot Table to analyze data more effectively. Here’s how to add a calculated field to a Pivot Table:

Step 1: Open the Pivot Table

  • Open the Excel workbook that contains your Pivot Table.
  • Ensure the Pivot Table is created and the data fields you want to use for calculations are present.

The image below summarizes the sales and cost data by region (row labels) and product (Column labels). The Pivot Table includes the following fields:

  • Columns: Products (Product A, Product B, Product C) with their respective "Sum of Sales" and "Sum of Cost."
  • Rows: Regions (East, North, South, West), showing totals for each region across all products.
  • Values: The sum of sales and costs for each product in each region, along with the grand totals for sales and costs at the bottom.
  • The Pivot Table Fields panel is visible on the right, displaying the fields used: Region (Rows), Sales, and Cost (Values), and Product (Columns). This setup allows for a clear analysis of sales and costs by product and region.
How to Add a Calculated Field to a Pivot Table in Excel
Pivot Table

Step 2: Access the Calculated Field Option

  • Click anywhere inside the Pivot Table to activate the PivotTable Analyze tab on the ribbon.
  • Go to PivotTable Analyze (or Options in older versions of Excel).
  • In the Calculations group, click Fields, Items & Sets, and then select Calculated Field.
How to Add a Calculated Field to a Pivot Table in Excel
Go to Analyze Tab>>Fields, Items and Sets >> Select Calculated Field

Step 3: Create a New Calculated Field

In the Insert Calculated Field dialog box that appears

Enter a name for your calculated field in the Name box (e.g., "Profit Margin")

Write the formula for the calculation in the Formula box using the available fields.

  • Use the Field list to select fields and click Insert Field to include them in the formula.
  • For example: To calculate "Profit Margin" as (Sales - Cost) / Sales, write:

=(Sales-Revenue)/ Sales

Click OK to add the calculated field.

How to Add a Calculated Field to a Pivot Table in Excel
Enter a Name for your Field >>Enter Formula >> click ok

Step 4: Preview the Calculated Field

  • The new calculated field will appear as a column or row in the Pivot Table based on your layout.
  • Excel will automatically perform the calculation for all data points in the Pivot Table.
How to Add a Calculated Field to a Pivot Table in Excel
Preview the Calculated Field

How to Modify a Calculated Field in Pivot Table

If you need to update or adjust a calculated field, follow these steps to modify a calculated field in Excel:

  • Click anywhere inside the Pivot Table.
  • Go to PivotTable Analyze > Fields, Items & Sets > Calculated Field.
  • In the dialog box, select the calculated field from the Name dropdown.
  • Modify the formula and click OK
How to Add a Calculated Field to a Pivot Table in Excel
Click on the Calculated Field Name Drop-Down >> Click on Modify>> Modify the Formula >> Click ok

How to Delete a Calculated Field in Pivot Table

If you need to delete a calculated field in Excel, follow these simple steps:

Step 1: Access the Calculated Field Option

Click anywhere inside the Pivot Table. Go to the PivotTable Analyze tab on the ribbon and then Click Fields, Items & Sets, and select Calculated Field.

How to Add a Calculated Field to a Pivot Table in Excel
Go to Analyze Option >>Select "Fields, Items & Sets" >> Click on Calculated Field

Step 2: Select the Field to Delete and Click on Delete

  • In the Insert Calculated Field dialog box, open the Name dropdown.
  • Select the calculated field you want to delete.
  • Click the Delete button in the dialog box and Confirm by clicking OK.
How to Add a Calculated Field to a Pivot Table in Excel
Click on the Drop-Down>>Select the Calculated Field>>Press Delete>> Click OK

Step 3: Preview Result

The calculated field will be removed from the Pivot Table.

imageHow to Add a Calculated Field to a Pivot Table in Excel
Calculated Field have been removed

Also Read:

Conclusion

Mastering the use of a Calculated Field in Pivot Table enhances your ability to perform dynamic calculations directly within your data analysis. Whether you want to add a calculated field to a Pivot Table, modify it for evolving needs, or delete a calculated field in Excel, these steps equip you with the skills to manage data effectively. Incorporate these Excel Pivot Table advanced tips to streamline your reporting process and achieve greater accuracy in your analysis.


Article Tags :

Similar Reads