Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Question Concerning Calculation of Average based on totals

Posted on 2016-09-28
5
Medium Priority
?
61 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
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 33

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

783 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