What a calculated field does and why you might need one
A calculated field in a pivot table is a new column you create that performs math on the data already in the table. Instead of going back to your source data and adding a formula there, you build the calculation directly into the pivot table itself. Excel then updates it automatically whenever you refresh the table.
You use a calculated field when you want to show something the original data doesn't contain — a percentage of total sales, a commission amount based on revenue, a cost per unit, or a margin. The calculation appears as its own column in the pivot table, and you can drag it to different areas just like any other field.
The alternative is to add a helper column to your source data before you build the pivot table. A calculated field is faster if you're experimenting with different calculations or if you don't want to clutter your original spreadsheet.
Key Takeaways
- Calculated fields live inside the pivot table and update when you refresh, so you don't have to edit your source data.
- You can only reference other fields in the pivot table — not individual cells from your source data — so the calculation must work on summarized numbers.
- The fastest route is to click inside the pivot table, go to the Analyze tab, and select Fields, Items & Sets, then Calculated Field.
- If the Calculated Field option is grayed out, your pivot table is built from a data model or external source, and you'll need to use a helper column instead.
The step-by-step process to add a calculated field
Start by clicking anywhere inside your pivot table. Then go to the Analyze tab in the ribbon (this tab only appears when a pivot table is selected). In the Analyze tab, look for the Fields, Items & Sets button — it's usually in the upper left area. Click it and select Calculated Field from the dropdown menu.
A dialog box will open titled "Insert Calculated Field". In the Name field at the top, type a name for your new column — something like "Commission" or "Cost Per Unit". Then click in the Formula field and type your calculation. You reference other fields by putting their names in single quotes and square brackets, like this: 'Sales'*0.15 to calculate 15 percent of sales, or 'Revenue'/'Units' to divide revenue by units.
Once you've entered the formula, click Add, then OK. Excel adds the calculated field to your pivot table when ready. It appears as a new column and is ready to use.
How to reference fields correctly in your formula
The most common mistake is forgetting the syntax. Field names must be wrapped in single quotes and square brackets: 'Field Name'. If your field is called "Total Sales", you write 'Total Sales'. If it's called "Units", you write 'Units'.
You can use basic math operators: the asterisk * for multiplication, the forward slash / for division, the plus sign + for addition, and the hyphen - for subtraction. You can also use parentheses to control the order of operations, just as you would in a regular Excel formula.
The fields you reference must already exist in your pivot table — either as fields you've dragged into the Values area, or as fields that are already summarized. You cannot reference a single cell from your source data or a field that isn't part of the pivot table structure.
Where the calculated field appears and how to move it
When you create a calculated field, Excel automatically adds it to the Values area of your pivot table. It shows up as a new column with your chosen name and displays the calculated result for each row.
You can move it around just like any other field. If you want it in a different position, right-click on the field name in the pivot table itself, select Move, and choose where you want it. You can also drag the field header to reposition it. If you want to remove it temporarily, drag it out of the Values area, or right-click and select Remove Field.
The calculated field stays in the pivot table even if you refresh the data. It recalculates automatically based on the new numbers, so you don't have to rebuild it.
Editing or deleting a calculated field
To change the formula, go back to the Analyze tab, click Fields, Items & Sets, and select Calculated Field again. The dialog will show your existing calculated fields in a list. Click the one you want to edit, change the formula, and click Modify. Then click OK.
To delete a calculated field, open the same dialog, select the field you want to remove, and click Delete. The column disappears from your pivot table when ready. This doesn't affect your source data — it only removes the calculation from the pivot table.
When calculated fields don't work and what to do instead
If the Calculated Field option is grayed out or missing, your pivot table is built from a data model or an external data source like a SQL database. In that case, you cannot add a calculated field directly to the pivot table. The workaround is to add a helper column to your source data before you build the pivot table, then include that column when you create the pivot table.
Another limitation: calculated fields work only on summarized data. If you need to calculate something based on individual rows in your source data — for example, a commission that depends on whether a sale was in a specific region — you must add that calculation to your source data first, then build the pivot table from the updated data.
If your formula references fields that don't exist or uses incorrect syntax, Excel will show an error message when you try to add the field. Check that all field names are spelled exactly as they appear in the pivot table and that they're wrapped in single quotes and square brackets.
Frequently Asked Questions
Can I use a calculated field to show a percentage of the total?
Yes, but only if the total is already a field in your pivot table. For example, if you have a "Total Sales" field, you can create a calculated field like 'Sales'/'Total Sales'*100 to show each row as a percentage. If the total doesn't exist as a separate field, add it to your source data first or use a regular Excel formula in a column next to the pivot table instead.
What happens to a calculated field when I refresh the pivot table?
The calculated field stays in place and recalculates automatically. If the underlying data changes, the formula applies to the new numbers. You don't have to rebuild the calculated field unless you want to change the formula itself.
Can I use IF statements or other functions in a calculated field?
No. Calculated fields accept only basic math operators and field references. If you need conditional logic, add a helper column to your source data with an IF formula, then include that column in your pivot table as a regular field.
Why does my calculated field show the same number for every row?
This usually means your formula doesn't reference any fields that change by row. For example, if you write 100*2, every row will show 200. Make sure your formula includes at least one field that varies across the rows of your pivot table, like 'Sales'*0.15.