Link to home
Start Free TrialLog in
Avatar of Matt Miller
Matt MillerFlag for United States of America

asked on

Question Concerning Calculation of Average based on totals

I have a data set that a number of product lines with different selling prices.
My pivot table correctly adds up the units and revenue but now I'm trying to get an average price per unit.

Thanks,
Avatar of Michael Graham
Michael Graham
Flag of United States of America image

Hello,

Where it says count of units at the top next to rowlables double click then choose average from the drop down menu.  You can drop the same field into the Values fields at the bottom right of the screen and have one for count, one for average, etc.

Hope this helps,

Mike
Avatar of Subodh Tiwari (Neeraj)
Drag the Selling Price field to the Values area one more time, a new column will be added into your pivot table showing the sum of selling price, now right click on any cell in that column within the pivot table --> choose Value Field settings --> from the available list of calculations, choose Average and click OK.
Matt,
One of the problems with PivotTables is that they don't do weighted averages. If you calculate the average price, you get an arithmetic average of the prices. If you calculate and average quantity, you get an arithmetic average of quantities. Dividing one of those numbers by the other does not give you the desired result,

Average price is found by taking Sum of revenue / Sum of quantities. Do the calculation by hand using the values reported in your PivotTable. You will quickly see that summarizing by Average won't give you that result. Nor does Average Sale / Average Quantity

I find it easiest to perform the weighted average calculation outside of the PivotTable. When you do so, do not build the formula by clicking on cells in the PivotTable. If you do, Excel will give you a GETPIVOTDATA function reference instead of the cell you clicked on--and this will give you the wrong answer. Instead, type the formula by hand, and enter the cell addresses yourself.

Brad
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Matt Miller

ASKER

Terrific solution.  This works perfectly and saving a manual step in the process.  

Thank you