Pivot Table( calculated field showing diffrence between two columns values show as % of the column)

CEOMisza

New Member
Joined
Dec 30, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hello,
I have a simple pivot table with name of a product and sum of sales in year 2021 and 2022 shown as procent of the total column). Im trying to add a calculated field that would show the diffrence between the two years. For istance in 2021 sales of apples was 15 and grand total of sales of all products was 100, so the value displayed is 15%. In 2022 the sales of apples were 10 and grand total sales of all products was 50 so value displayed 20%. Im looking for a calculated filed that would display the diffrence between 20% and 15% and not 15 and 10. So the result im looking for would be 5% in this example.

Thank you for your help and sorry for my English, I hope u understand the issue.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the Forums! It is best to post actual data using XL2BB so that people that help have a little less work to do and can be more accurate. It's great that you have your Excel & OS Versions in your profile.
The Calculated Field formula
Excel Formula:
=('2022'-'2021')/'2021'
seems to work fine where the values (NOT percentages) of the 2021 and 2022 sales are used. From this table:
Book1
ABC
1Product20212022
2ad hoc crush70368259
3fluttering marble46612710
4pine green group16885707
Sheet5

I got this Pivot Table
Book1 (version 2).xlsb
EFGH
3Row Labels% of 2021 Total% of 2022 TotalY/Y % Change
4ad hoc crush8.78%7.51%8.81%
5apparel9.09%8.76%22.54%
6auburn join10.50%10.14%22.91%
7cardinal balance9.97%13.07%66.70%
8carmine farmer5.31%7.19%72.22%
9celadon trade7.59%6.92%15.98%
10cinnabar copper14.49%12.05%5.80%
11cloistered cart13.11%6.51%-36.85%
12fluttering marble6.89%7.28%34.33%
13old lavender basket6.32%9.00%81.08%
14pine green group7.97%11.57%84.73%
15Grand Total100.00%100.00%27.17%
Sheet5

In the Pivot Table, the values shown are % of Grand Total.
And confirmed with formulas:
Book1
EFGHI
18ad hoc crush13,21814,3821,1648.81%
19apparel13,68316,7673,08422.54%
20auburn join15,80419,4243,62022.91%
21cardinal balance15,01125,02310,01266.70%
22carmine farmer7,99513,7695,77472.22%
23celadon trade11,42213,2471,82515.98%
24cinnabar copper21,81023,0751,2655.80%
25cloistered cart19,73312,4617,272-36.85%
26fluttering marble10,37813,9413,56334.33%
27old lavender basket9,51217,2247,71281.08%
28pine green group11,99222,15310,16184.73%
Sheet5
Cell Formulas
RangeFormula
E18:E28E18=SORT(UNIQUE(Table1[Product]))
F18:F28F18=SUMIFS(Table1[2021],Table1[Product],E18#)
G18:G28G18=SUMIFS(Table1[2022],Table1[Product],E18#)
H18:H28H18=G18#-F18#
I18:I28I18=H18#/F18#
Dynamic array formulas.

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top