Change Formula Calculated Field Pivot Table: Fix
- Average speed
- km/h
- Result
- Finish time
- 50 min
- You entered
- Distance
- 10 km
- You entered
To change the formula in a calculated field within an Excel pivot table, you must edit the field through the PivotTable Tools menu—there is no direct way to type a new formula into the cell. You can modify or delete the formula by going to Analyze > Fields, Items, & Sets > Calculated Field, selecting the field name, and updating the formula in the dialog box.
Formula
The average pace is the total time divided by the distance:
pace = t / d
where:
- t = finish time in minutes
- d = distance in kilometers
The speed in km/h is distance divided by time in hours:
speed = d / (t / 60)
because t/60 converts minutes to hours.
Worked Example
Using the default values (t = 50 min, d = 10 km):
- pace = 50 / 10 = 5.00 min/km
- speed = 10 / (50/60) = 10 / 0.8333 = 12.00 km/h
The calculator shows 5.00 min/km and 12.00 km/h.
Why You Need to Edit a Calculated Field
Calculated fields in pivot tables let you create new data by applying a formula to existing fields. For example, you might add a field that calculates profit (Sales – Cost) or a percentage (Profit / Sales). Over time, business rules change, or you spot an error in the original formula. Unlike a regular cell formula, you cannot simply click on a pivot value and edit it—the calculated field is stored centrally, so you must update it through the menu.
How to Change a Calculated Field Formula (Step by Step)
- Click anywhere inside the pivot table to activate the PivotTable Tools on the ribbon.
- Go to the Analyze tab (or Options in some versions).
- In the Calculations group, click Fields, Items, & Sets.
- Choose Calculated Field from the drop-down.
- In the dialog box, select the field you want to change from the Name drop-down.
- The current formula appears in the Formula box. Edit it directly.
- Click Modify, then OK.
The pivot table updates immediately. If you want to remove the field entirely, select it and click Delete.
Common Reasons Why the Formula Won’t Change
- You’re editing the wrong field – The name must match exactly, including spaces.
- The field is used in a GETPIVOTDATA formula – External references may not update until you refresh.
- You’re trying to change a calculated item, not a field – Calculated items work differently and appear in a separate menu.
- Your pivot table is based on a data model – In Power Pivot, calculated fields are DAX measures, not the same as classic calculated fields.
How to Choose Between a Calculated Field and a Calculated Item
Calculated fields work on the sum of underlying data, such as adding two fields together. Calculated items work on individual items within a field, like comparing two products. If you need to change a formula that uses a field name, use a calculated field. If you need to create a new category from existing items, use a calculated item. Choosing the wrong one often leads to confusing results or errors.
Limitations of Calculated Fields
- You cannot reference cells directly—only field names.
- Formulas cannot use worksheet functions like SUMIF or VLOOKUP.
- The result is always a sum, not an average or count, unless you use the appropriate function in the formula.
- You cannot use a calculated field in another calculated field’s formula.
Frequently Asked Questions
Why is my calculated field showing #DIV/0! after I change it?
This usually means the denominator in your formula is zero for some rows. For example, if you divide by a field that contains zero or is empty, Excel returns an error. Check your data for blanks or use an IFERROR function in the formula, but note that IFERROR is not allowed in calculated fields. Instead, adjust the formula to avoid division by zero, or clean the source data.
Can I change a calculated field formula without opening the dialog box?
No, there is no shortcut to type directly into a pivot cell. The only way is through the Calculated Field dialog. However, you can use VBA to automate the change if you have many fields, but that requires programming knowledge.
Why does my calculated field disappear when I refresh the pivot table?
Calculated fields are stored with the pivot table, not the source data. If you delete the pivot table and recreate it, the calculated field is lost. Also, if you change the source data range, the field remains but may show errors if field names change. To keep it, save the workbook with the pivot table intact.
Can I use a calculated field in a pivot chart?
Yes, calculated fields appear in pivot charts just like any other field. However, if you change the formula, the chart updates automatically. Be aware that some chart types may not display calculated fields correctly if they return text or errors.
Is there a difference between calculated fields in Excel and Google Sheets pivot tables?
Yes. In Google Sheets, calculated fields are added via the pivot table editor, and the syntax is slightly different (e.g., you use SUM() around field references). The steps to edit are similar but located under “Add� > “Calculated field� in the editor. The underlying concept is the same, but the interface differs.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.