A calculated field lets you create a new column in your pivot table based on math you define
A calculated field is a column you add to a pivot table that performs a calculation using the data already in the table. Instead of manually entering formulas in cells next to your pivot table, you define the calculation once, and it applies to every row. The most common use is dividing one field by another — for example, dividing total sales by quantity to get average price per unit — but you can add, subtract, multiply, or use more complex formulas.
The steps differ slightly between Excel and Google Sheets, but the concept is the same: you tell the pivot table which fields to use and what operation to perform. Once created, the calculated field appears as a new column in your pivot table and updates automatically if your source data changes.
Key Takeaways
- In Excel, right-click the pivot table, select Fields, Items, and Sets, then choose Calculated Field to define your formula.
- In Google Sheets, click the pivot table, open the Data menu, select Pivot table, then add a calculated field from the Values section.
- Calculated fields use field names in curly brackets — for example, {Sales}/{Quantity} — not cell references like A1 or B2.
- A calculated field applies to the entire pivot table at once, so you do not need to copy a formula down to each row.
Adding a calculated field in Excel
Open your spreadsheet and click anywhere inside the pivot table. Go to the Pivot Table Analyze tab (or Pivot Table Tools in older Excel versions). In the Calculations group, click Fields, Items, and Sets, then select Calculated Field from the dropdown menu.
A dialog box opens with two fields: Name and Formula. Type a name for your new field — something like "Price Per Unit" or "Profit Margin" that describes what it calculates. In the Formula field, type your calculation using field names in curly brackets. For example, to divide Sales by Quantity, type ={Sales}/{Quantity}. Do not use cell references like A1 or B2; the pivot table only recognizes field names.
Click Add, then OK. The new calculated field appears in your pivot table as a new column. If you need to edit it later, return to Fields, Items, and Sets, select the calculated field from the list, change the formula, and click Modify.
Adding a calculated field in Google Sheets
Click anywhere in your pivot table. Open the Data menu and select Pivot table. The pivot table editor panel opens on the right side of your screen. Scroll down to the Values section and click Add.
A dropdown menu appears showing the fields in your data. Instead of selecting an existing field, look for the option to create a calculated field — in Google Sheets this is usually labeled "Create a field" or appears as a formula icon. Click it, and a formula editor opens. Type a name for your field and then enter your formula using field names. For example, =Sales/Quantity or =Revenue-Cost. Google Sheets uses a simpler syntax than Excel and does not require curly brackets.
Click Create or Save. The calculated field is added to your pivot table immediately. To change it later, click the field in the Values section and select Edit.
Common formulas and what they calculate
The formula you use depends on what question you are trying to answer. Here are formulas that work in both Excel and Google Sheets (adjust the field names to match your data):
| What you want to find | Formula | Example |
|---|---|---|
| Average price per item | {Revenue}/{Units Sold} | Total sales divided by number of items |
| Profit or loss | {Revenue}-{Cost} | Income minus expenses |
| Profit as a percentage of revenue | ({Revenue}-{Cost})/{Revenue} | Shows profit margin |
| Growth from one period to another | {Current Period}-{Previous Period} | Month-to-month or year-to-year change |
| Percentage of total | {Amount}/{Total Amount} | One region's sales as a percent of all sales |
When you use parentheses in a formula, the pivot table calculates what is inside the parentheses first, just like regular math. This matters when you are mixing operations — for example, ({Revenue}-{Cost})/{Revenue} gives you a different result than {Revenue}-{Cost}/{Revenue}.
Why a calculated field is better than a helper column
You could create the same calculation in a column next to your pivot table using a regular formula. A calculated field is faster and cleaner because it lives inside the pivot table itself. If you add or remove rows from your pivot table by changing filters or grouping, the calculated field updates automatically. A helper column in a separate area of the spreadsheet does not.
Calculated fields also keep your spreadsheet organized. Instead of having formulas scattered around your pivot table, everything stays in one place. And if you share the spreadsheet with someone else, they see the calculation as part of the pivot table, not as a separate formula they might accidentally delete or change.
Troubleshooting calculated fields that do not work
The most common mistake is using the wrong field name. Check that the name you typed in your formula matches exactly — including capitalization and spacing — the name of the field in your pivot table. If your field is called "Sales Amount" and you type {Sales}, the pivot table will not recognize it.
Another issue is trying to use a calculated field in a calculated field. Some versions of Excel and Google Sheets do not allow this. If you need a multi-step calculation, combine all the steps into one formula instead — for example, ({Revenue}-{Cost})/{Revenue} instead of creating one field for profit and then dividing it by revenue.
If your calculated field shows an error like #DIV/0!, it usually means you are dividing by zero somewhere. This happens when one of the fields in your denominator contains a zero or is empty. You can work around this in some spreadsheets by using an IF statement to check for zero first, though the syntax varies between Excel and Google Sheets.
When to use a calculated field versus a formula in your source data
If you are only using the calculation in a pivot table, a calculated field is the right choice. But if you need that calculation in your regular spreadsheet data too — not just in the pivot table — add a formula column to your source data before you create the pivot table. The pivot table will then include that column as a regular field, and you can use it in multiple pivot tables without recreating the formula each time.
For one-time analysis or a calculation that only makes sense in the context of a specific pivot table, a calculated field keeps things simple and contained.
Frequently Asked Questions
Can I use a calculated field to divide by the total of another field?
Not directly in a single calculated field. Calculated fields work with the values already in the pivot table, not with grand totals. If you need to show each row as a percentage of the grand total, add a helper column to your source data with that formula, then include it in the pivot table as a regular field.
What happens to a calculated field if I refresh my pivot table?
The calculated field stays in place and recalculates based on the new data. The formula itself does not change unless you edit it. If you delete and recreate the pivot table, you will need to recreate the calculated field as well.
Can I use IF statements or other functions in a calculated field?
Excel calculated fields support some functions like SUM and AVERAGE, but not IF statements. Google Sheets is more flexible and allows more function types. Check your spreadsheet's documentation for which functions are supported in calculated fields.
How do I delete a calculated field I no longer need?
In Excel, go to Fields, Items, and Sets, select the calculated field from the list, and click Delete. In Google Sheets, click the calculated field in the Values section of the pivot table editor and select Remove.