Solved

Question Concerning Calculation of Average based on totals

Posted on 2016-09-28
5
44 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
Comment Utility
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 28

Expert Comment

by:Subodh Tiwari (Neeraj)
Comment Utility
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 80

Expert Comment

by:byundt
Comment Utility
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
Comment Utility
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
Comment Utility
Terrific solution.  This works perfectly and saving a manual step in the process.  

Thank you
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now