Introduction
Microsoft Excel is powerful data visualisation and analysis software, which uses spreadsheets to store, organise, and track data sets with formulas and functions. Excel is used by marketers, accountants, data analysts, and other professionals. It's part of the Microsoft Office suite of products.
Calculated fields and calculated items are custom formulas in an Excel pivot table.
There are a few limitations to utilising pivot table formulas in general:
- Formulas are only available in pivot tables that aren't OLAP(Overview of Online Analytical Processing)-based.
- Formulas that relate to the totals or subtotals in the pivot table can't be created.
- Worksheet cells cannot be referenced by address or name in formulas.
You may use a built-in command to create a list of all the formulas in a pivot table after you've created them.
We'll set up a pivot table using both types of formulas in the examples below to examine where and how each style of formula performs best.
Calculated Field
The following are the main characteristics of the calculated fields in the pivot table:
- To do calculations on other values in the pivot table, we use calculated fields.
- The individual amounts in the other fields are first added together, and then the total amount is calculated.
- For a calculated field, the sum function is the sole option.
- A calculated field is added to the pivot table as a new field, and its computation can include the sum of other fields.
- In the pivot table, calculated fields show with the other value fields. A computed field's name, like those of other value fields, might be preceded by ‘Sum of’.
- The PivotTable Field List shows calculated fields.
Example
The data from another field are used in a computed field. Execute the procedures below to create a calculated field.
Product, Quantity, and Sales are the three fields of the source data. A calculated field called "Unit Price" is the fourth field.
Select "Insert Calculated Field" from the "Fields, Items, and Sets" menu on the ribbon to create the calculated field:
The calculated field "Unit Price" is called after the formula "=Sales/Quantity," as shown below:
Note: Single quotes (') must be used to surround field names with spaces. When you click the Insert Field button or double-click a field in the list, Excel will automatically add these.
After being added to the Values area, the Unit Price field is renamed "Unit Price " (notice the extra space).
Excel won't let you use the exact same field name that exists in the data in a pivot table, so you'll need the extra space.