How can I calculate the difference between two pivot tables in Excel? 2

How can I calculate the difference between two pivot tables in Excel?

To calculate the difference between two pivot tables in Excel, you can use the “GetPivotData” function. This function allows you to retrieve data from a specific pivot table, which can then be subtracted from the data retrieved from another pivot table. This will give you the difference between the two pivot tables. Additionally, you can use the “PivotTable Tools” to add calculated fields or items to your pivot tables, which can also help in finding the difference between them. By using these methods, you can easily compare and analyze the data in different pivot tables in Excel.

Excel: Calculate the Difference Between Two Pivot Tables


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 .

Additional Resources

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

Cite this article

stats writer (2024). How can I calculate the difference between two pivot tables in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-calculate-the-difference-between-two-pivot-tables-in-excel/

stats writer. "How can I calculate the difference between two pivot tables in Excel?." PSYCHOLOGICAL SCALES, 30 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-calculate-the-difference-between-two-pivot-tables-in-excel/.

stats writer. "How can I calculate the difference between two pivot tables in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-calculate-the-difference-between-two-pivot-tables-in-excel/.

stats writer (2024) 'How can I calculate the difference between two pivot tables in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-calculate-the-difference-between-two-pivot-tables-in-excel/.

[1] stats writer, "How can I calculate the difference between two pivot tables in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can I calculate the difference between two pivot tables in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top