Pivot table calculated field difference between two columns

The following step-by-step example shows how to subtract two columns in a pivot table in Excel.

Step 1: Enter the Data

First, let’s enter the following data for three different sales teams:

Step 2: Create the Pivot Table

To create a pivot table, click the Insert tab along the top ribbon and then click the PivotTable icon:

In the new window that appears, choose A1:C16 as the range and choose to place the pivot table in cell E1 of the existing worksheet:

Once you click OK, a new PivotTable Fields panel will appear on the right side of the screen.

Drag the Team field to the Rows box and drag the Sales and Returns fields to the Values box:

The pivot table will automatically be populated with the following values:

Step 3: Subtract Two Columns in the Pivot Table

Suppose we would like to create a new column in the pivot table that displays the difference between the Sum of Sales and Sum of Returns columns.

To do so, we need to add a calculated field to the pivot table by clicking on any value in the pivot table, then clicking the PivotTable Analyze tab, then clicking Fields, Items & Sets, then Calculated Field:

In the new window that appears, type whatever you’d like in the Name field, then type = Sales – Returns in the Formula field.

Then click Add, then click OK.

This calculated field will automatically be added to the pivot table:

This new field displays the difference between the sum of sales and sum of returns for each sales team.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

How to Create Tables in Excel
How to Group Values in Pivot Table by Range in Excel
How to Group by Month and Year in Pivot Table in Excel

Can a pivot table calculate the difference between two columns?

Instead of creating your own calculated field in an Excel pivot table, you can use built-in custom calculations. For example, with the Show Values As command, you can add these calculations: difference between amounts in two columns.

How do I find the percentage difference between two columns in a pivot table?

Calculate the Percent Difference Right-click one of the % Diff cells in the Values area, and click Value Field Settings. Click the Show Values As tab, and from the drop-down list for Show Values As, select % Difference From. You want to compare the Status field values, so for the Base field, select Status.

Can pivot table calculate difference?

If there are multiple fields in the pivot table Row area, the differences will be calculated on the base field that you select. If necessary, rearrange the row fields, so the differences are easy to understand. For example, in the two examples shown below: Region is the outer Row field.

How do I subtract two calculated fields in Excel?

Subtraction formula in Excel (minus formula) To enter the formula in your worksheet, do the following: In a cell where you want the result to appear, type the equality sign (=). Type the first number followed by the minus sign followed by the second number. Complete the formula by pressing the Enter key.

Toplist

Latest post

TAGs