This post explains how to add a calculated field in your pivot table with other columns. Most often, after generating your pivot table, you may ask to add more columns for further analysis. Eg. if you have sales data and have to report the growth positive or negative in an additional field in your pivot table.
Suppose you have the below sales data, create a summary table to display the sum of sales by representative field, and need to add a column to highlight the positive or negative growth.
In the data set, you have given four fields Representative, Prod, Sales_H1, and Sales_H2 with 250 records of data.
Add Pivot table in excel
Please follow the below steps to add a pivot table to your worksheet
- Select your entire data set A1:D251
- Go to Insert menu
- Select PivotTable – to open PivotTable from table or range dialog box
- Make sure the Table/Range is covered your entire data range
- Select New Worksheet, you can choose Existing worksheet if you need the pivot in the same worksheet
- Press OK
Now you added a pivot table in a new worksheet, you can see the blank pivot table
Please follow the below steps to add the fields into your pivot and additional calculated fields
- Drag the Representative field to the Rows pane
- Drag both Sales_H1 and Sales_H2 fields to the Values pane
- Click any Pivot cell – you can see the PivotTable Tools menu in the excel ribbon
- Go to PivotTable Analyze
- Select Fields, Items, & Sets
- Choose Calculated Field – to open Insert calculated field dialog box
- Type calculated field name Growth in the Name input box
- Type the below formula in the Formula input box
=Sales_H2 -Sales_H1
- Press Add
- Press OK
Your final output will look like the below image. Later you can rename headers or format the pivot table to match your report template.
Conclusions
The pivot table is one of the most powerful tools in excel. It helps you to create a summary table and the slicer allows you to filter the data for your reports and analysis.
If you are very familiar with pivot tables you can use the pivot to create a dashboard in excel.