• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pivot table calculation field results

hi

Please find the attached copy of excel sheet with pivot table data which is showing two different % of revenue from the same data source and value. Can you check How it's calculated the both value and guide me to get the correct answer?
 

Attachments

  • % Difference copy copy.xlsx
    30.9 KB · Views: 5
So Rev field uses...
=('Sales Value'-'Total Sales Cost')/'Sales Value'

Rev New uses...
=((('Desp. Qty. in Ltr.'*'Selling Price / Ltrs. ')-('Desp. Qty. in Ltr.'*Cost))/('Desp. Qty. in Ltr.'*'Selling Price / Ltrs. '))

In regular excel formula each translates to...

Rev
=(SUM('Sales Value')-SUM('Total Sales Cost'))/SUM('Sales Value')

Rev New
=((SUM('Desp. Qty. in Ltr.')*SUM('Selling Price / Ltrs. '))-(SUM('Desp. Qty. in Ltr.')*SUM(Cost)))/(SUM('Desp. Qty. in Ltr.')*SUM('Selling Price / Ltrs. '))

This is where the issue lies.

Rev New formula should be.
=(SUMPRODUCT('Desp. Qty. in Ltr.','Selling Price / Ltrs. ')-SUMPRODUCT('Desp. Qty. in Ltr.',Cost))/SUMPRODUCT('Desp. Qty. in Ltr.','Selling Price / Ltrs. ')

However, PivotTable calculated field works by doing SUM of each column (based on row label grouping) before any other calculations are performed. Giving unexpected result.

Therefore Rev is the correct value.
 
Back
Top