+ Reply to Thread
Results 1 to 3 of 3

weighted average % calculation in pivot table

  1. #1
    Registered User
    Join Date
    06-03-2011
    Location
    Florida, USA
    MS-Off Ver
    Excel 2013
    Posts
    46

    weighted average % calculation in pivot table

    Hi, this is I think a simple question but it is puzzling me.

    I want to do a weighted average calculation in a pivot table. I have different product categories (call them A,B ,C etc). I have profit in an excel sheet for each product sold by customer and date. In the sheet I have a column calculated for margin % ((sales - cost)/sales) each time a product category is sold. In the Pivot table however, it appears that Excel only does a simple average of this column.

    I thought I could solve the problem by using the actual margin (sales - cost) and then summing it in the pivot table and then dividing that by the total sales for each product category. I went to Value Field Settings, Show Value as and I tried to do it as a percentage of ... but I am not doing it correctly since I could not figure out how to use the sum of the sales value for A as the denominator or base item using the calculation tab. I have attached a simple sheet to show what I need. Thanks.EXAMPLE OF WEIGHT AVERAGE NEEDED.xlsx
    Last edited by maymano; 08-28-2013 at 08:17 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: weighted average % calculation in pivot table

    Instead of a PT, you could create a simple table and use this, copied down and across...
    =SUMIF($B$2:$B$7,$E16,C$2:C$7)
    Then jusdt use the same formula you were using in the 1st table
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-03-2011
    Location
    Florida, USA
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: weighted average % calculation in pivot table

    Thanks - yes, that can work but I do have other reasons to wanting to use the pivot table. There are other sub categories I am analyzing too which include domestic and import etc. It is useful to have these collapsible sub fields as part of the table. I thought I could point to the Sales Value of A as the total for denominator and then take (Sum of Profit Margin for A / Total Sales Value for A as the base field) to get my %. That automatically takes into account the weighted average. Is there a way to do that in Pivot tables?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Collapse/Expand - Pivot table Fields - Need equivalent option in Excel VBA Pivot table
    By ragavendraph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2012, 03:00 PM
  2. Pivot table - change data source to another pivot table in 2010
    By thesecretsanta in forum Excel General
    Replies: 4
    Last Post: 04-13-2011, 12:54 PM
  3. Replies: 1
    Last Post: 06-22-2010, 09:10 AM
  4. Replies: 1
    Last Post: 06-20-2010, 04:00 AM
  5. Return pivot table range...not the data table, the PIVOT TABLE!
    By Air_Cooled_Nut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2008, 01:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1