Solved

Question Concerning Calculation of Average based on totals

Posted on 2016-09-28
5
56 Views
Last Modified: 2016-09-30
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,
0
Comment
Question by:mattfmiller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:Michael Graham
ID: 41821015
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
0
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41821100
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.
0
 
LVL 81

Expert Comment

by:byundt
ID: 41821106
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
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 41824029
While I agree with Brad that you can't get weighted averages, I don't think you're needing that.  You can create a Calculated Field in the PivotTable that would provide the average price per unit, provided that there is a quantity field available and a sales field.

The following graphic shows this example.  There are fields labeled "Qty" and "Sales".  A Calculated Field called "Average Price" is created that has the formula =Sales/Qty.  That field is automatically added to the PivotTable once created.
EE-CalcField2.pngThe advantage is that you can drill down to additional row values and the field will recalculate appropriately.

-Glenn
0
 
LVL 1

Author Closing Comment

by:mattfmiller
ID: 41824164
Terrific solution.  This works perfectly and saving a manual step in the process.  

Thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question