16.2 C
London
Wednesday, June 4, 2025
HomeExcelDescriptive Statistics in ExcelExcel: How to Calculate the Difference Between Two Pivot Tables

Excel: How to Calculate the Difference Between Two Pivot Tables

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

The following example shows how to calculate the difference between two pivot tables in Excel.

Example: Calculate Difference Between Two Pivot Tables

Suppose we have the following two pivot tables that show the total sales and returns for different stores during two different years:

Suppose we would like to calculate the difference in the Sum of Sales and Sum of Returns columns between the two pivot tables.

To calculate the difference in the Sum of Sales columns between the two pivot tables for just store A, we can type the following formula:

=GETPIVOTDATA("Sum of Sales",$E$2,"Team","A")-GETPIVOTDATA("Sum of Sales",$E$10,"Team","A")

The following screenshot shows how to use this formula in practice:

Excel calculate difference between two pivot tables

Notice that this formula correctly calculates the difference between the Sum of Sales values between 2020 and 2019 for store A.

Difference = 38 – 16 = 22.

We can change the values in the GETPIVOTDATA formula to calculate the difference between each corresponding value in the two pivot tables:

Note: You can find the complete documentation for the GETPIVOTDATA function in Excel here.

Additional Resources

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

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

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories