What a calculated field does in a pivot table

A calculated field in a pivot table lets you create a new column that performs math on the data already in your table. Instead of building the formula in a separate cell, you define it once and Excel applies it to every row automatically. This is useful when you need a calculation that doesn't exist in your source data — like profit margin, commission amount, or cost per unit.

The calculated field lives inside the pivot table itself, so when you refresh your data, the calculation updates along with it. You don't have to rebuild the formula or worry about it breaking when your numbers change.

Key Takeaways

  • Calculated fields work only with numeric data and appear as a new column in your pivot table's values area.
  • You create a calculated field by right-clicking the pivot table, selecting "Fields, Items & Sets," then "Calculated Field," and entering your formula using field names in square brackets.
  • A formula like =Sales-Cost or =[Revenue]/[Units] references other columns in your pivot table by their exact names.
  • If your calculation doesn't appear, check that you placed it in the values area of the pivot table and that your formula uses the correct field names.

How to insert a calculated field step by step

Start with a pivot table that already contains the data you want to calculate from. Click anywhere inside the pivot table to select it. Then go to the Analyze tab (or PivotTable Analyze depending on your Excel version) in the ribbon at the top.

In the Analyze tab, find the Calculations group and click Fields, Items & Sets. A dropdown menu appears. Select Calculated Field from that menu. A dialog box titled "Insert Calculated Field" opens.

In the Name field at the top, type a name for your new column — something like "Profit" or "Commission Rate". Then click in the Formula field and type your calculation. Reference other columns by putting their exact names in square brackets, like =[Sales]-[Cost] or =[Revenue]/[Units]. Click OK when you're done.

Excel adds your calculated field to the values area of the pivot table. If it doesn't appear, drag it from the field list into the values section manually.

Writing the formula correctly

The formula syntax in a calculated field is straightforward but requires exact field names. If your pivot table has columns named "Revenue," "Expenses," and "Units," you reference them as [Revenue], [Expenses], and [Units]. The square brackets are required.

Common formulas include subtraction (=[Revenue]-[Expenses]), division (=[Profit]/[Revenue]), and multiplication (=[Units]*[Price]). You can also nest functions: =IF([Sales]>1000,[Sales]*0.1,0) calculates a 10% bonus only when sales exceed 1000.

If you type a field name incorrectly or forget the square brackets, Excel shows an error when you click OK. Go back and check the exact spelling and capitalization of each field name. The field names must match what appears in your pivot table's column headers.

Where the calculated field appears in your pivot table

Once you create a calculated field, Excel automatically places it in the Values area of your pivot table. It shows up as a new column to the right of your existing data. The column header displays the name you gave it.

If you want to move it to a different position, you can drag it within the values area, or you can remove it temporarily and add it back in a different spot. Right-click the calculated field name in the pivot table and select Move to reposition it, or Remove if you no longer need it.

Editing or deleting a calculated field

To change a calculated field after you've created it, click anywhere in the pivot table, go to Analyze > Fields, Items & Sets > Calculated Field again. The Insert Calculated Field dialog opens, but this time it shows your existing calculated fields in a list. Select the one you want to edit and change the formula, then click OK.

To remove a calculated field entirely, right-click it in the pivot table and select Remove. You can also go back to the Calculated Field dialog, select the field from the list, and click Delete.

Common reasons a calculated field doesn't work

If your calculated field doesn't appear or shows an error, the most common cause is a mismatch between the field names in your formula and the actual column names in your pivot table. Open the Calculated Field dialog again and compare each name character by character. Excel is case-sensitive for spaces and punctuation.

Another issue is trying to use a calculated field on non-numeric data. Pivot tables can only perform math on numbers, so if you're referencing text columns, the formula fails. Make sure every field in your formula contains numeric values.

If the calculated field appears but shows blank cells or zeros, check whether the underlying data in your pivot table actually contains values. A calculated field can only work with data that's already there. If a row in your pivot table is empty, the calculated field for that row will be empty too.

Frequently Asked Questions

Can I use a calculated field to divide one sum by another sum?

Yes. If your pivot table has a "Total Sales" column and a "Total Units" column, you can create a calculated field with the formula =[Total Sales]/[Total Units] to get the average price per unit. The calculation applies to each row in your pivot table.

What's the difference between a calculated field and a calculated item?

A calculated field creates a new column with a formula applied to every row. A calculated item combines existing values within a single field — for example, grouping three regions together as "Northeast." Use calculated fields for math across columns; use calculated items to reorganize rows.

Does a calculated field update automatically when I refresh the pivot table?

Yes. When you refresh your pivot table to pull in new source data, the calculated field recalculates automatically using the same formula you defined. You don't have to rebuild it.

Can I use IF statements or other functions in a calculated field?

Yes. You can use Excel functions like IF, SUM, AVERAGE, and others inside a calculated field formula. For example, =IF([Profit]>0,[Profit],0) shows profit only when it's positive, otherwise shows zero.

Why does my calculated field show the same value for every row?

This usually means your formula references a single cell or a fixed number instead of field names in square brackets. Double-check that you're using =[FieldName] syntax, not =A1 or =100. The formula needs to reference the pivot table's fields, not external cells.