Solved

Question Concerning Calculation of Average based on totals

Posted on 2016-09-28
5
50 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 29

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

776 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