
PivotTable Calculated Fields: Do Math on Your Data
PivotTable Calculated Fields: Do Math on Your Data
PivotTables summarize your data beautifully, but sometimes you need a calculation that does not exist in your source data. Calculated Fields let you create new, virtual columns inside the PivotTable by writing a formula using existing fields — without adding any columns to your source data.
What Is a Calculated Field?
A Calculated Field is a formula you define within the PivotTable itself. It uses other fields as inputs and creates a new summary column. For example, if your data has a Revenue field and a Cost field, you can create a Profit calculated field that subtracts Cost from Revenue — the PivotTable shows profit for every row automatically.
How to Create a Calculated Field
- Click anywhere in the PivotTable.
- Go to PivotTable Analyze → Fields, Items, and Sets → Calculated Field.
- In the dialog, give your field a name (e.g., Profit Margin).
- In the Formula box, write your formula using field names: Revenue minus Cost, or Revenue divided by Units, etc.
- Click Add, then OK.
The new calculated field appears in the Values area and is ready to use.
Important Behavior to Understand
Calculated Fields perform their math on the summarized values in the PivotTable, not on individual rows of source data. For simple calculations like Revenue minus Cost this works perfectly. For ratios and percentages, you need to be careful — dividing a total by another total is not the same as averaging the ratio across rows.
Calculated Items
Different from Calculated Fields, Calculated Items create new row or column entries that are combinations of existing items. For example, you might create a calculated item called Q1+Q2 that combines the first two quarters into a single summary row.
Show Values As
Before creating a Calculated Field for percentages, check if Show Values As can achieve what you need. Click a value field dropdown in the Values area, choose Value Field Settings, and click the Show Values As tab. Options include: Percent of Grand Total, Percent of Column Total, Running Total, Rank, and more — all without writing a formula.