top of page

You are learning PivotTables in MS Excel

How to calculate differences or comparisons between data sets in a PivotTable?

There are two main ways to calculate differences or comparisons between data sets in a PivotTable:

1. Using Value Field Settings:

This method allows you to display the difference between two versions of the same data set within a single value field.

Here's how:

* Create your PivotTable: Ensure you have your PivotTable set up with the desired rows and columns.
* Right-click on a value field: Choose the value field you want to calculate the difference for (e.g., Sum of Sales).
* Select "Value Field Settings": This option will be available in the context menu.
* Go to the "Show Values As" tab: In the Value Field Settings window, navigate to the "Show Values As" tab.
* Choose "Difference From": Select this option from the dropdown menu.
* Set the "Base Field" and "Base Item":
- Base Field: Choose the field that determines the comparison base (e.g., Year, Month).
- Base Item: Select the specific item within the base field to compare against (e.g., Previous Year, Specific Month).

2. Using Calculated Items:

This approach allows you to create a new field specifically showing the difference between two existing value fields.

Here's how:

* Click within the PivotTable: Make sure you're clicked somewhere within the PivotTable area.
* Go to the "PivotTable Analyze" tab: This tab should appear on the ribbon when you have a PivotTable selected.
* Click "Fields, Items, & Sets": This option is located in the "Calculate" group of the PivotTable Analyze tab.
* Choose "Calculated Item": Select this option from the dropdown menu.
* Name your calculated item: Enter a descriptive name for your difference calculation (e.g., "Sales Difference").
* Enter the formula: In the formula box, type the expression for the difference. It will involve referencing the existing value fields you want to compare (e.g., `[Sales This Year] - [Sales Last Year]`).
* Click "OK": This will create a new field in your PivotTable displaying the calculated difference.

Remember, you can use these methods to compare various data points within your PivotTable, providing valuable insights into changes, growth, or other trends.

bottom of page