Closed Thread
Results 1 to 13 of 13

Pivot Table: adding a percentage field as '% of Subtotal'

  1. #1
    Registered User
    Join Date
    11-13-2007
    Posts
    5

    Pivot Table: adding a percentage field as '% of Subtotal'

    Hello,

    In the attached Excel file, there is a pivot table.

    In the Data part of the table, there are two columns. The second is the exact same field than the first one but expressed as percentage (Field settings/Options/Show field as "% of" + "Total".

    The problem is: I don't want to express this field as a % of Total ('Grand total') but rather as a % of Subtotal (e.g. Danemark Total).

    Is this possible and how should I do it?

    Any help is appreciated, thank you!

    Xavier
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075
    In the field properties there's an option to make it "% of" and then select the relevant field - I picked Country. I can make the function work but the %'s are screwy in my version of your workbook, but it might be a starting point for you.
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  3. #3
    Registered User
    Join Date
    11-13-2007
    Posts
    5

    Pivot tables: adding a percentage calculated field of subtotals

    Hey,

    Good idea, but that's not it.

    If you pick country, then you have to choose a country ('e.g. Denmark).

    Then, for each cell of the table, it will calculates the % of units sold by a company in the country in comparison with... the percentage of units sold by the same company in Denmark.

    So in Denmark, you get either 100% (when the company sold something in Denmark) or error DIV/0 (when the company sold nothing in Denmark).

    I can't believe there is no possibility to choose '% Of' SUBTOTAL (instead of TOTAL). That's a shitty move!

    Can I call SUBTOTALS in formulas maybe?

    Cheers and thanks for trying anyway!

    Xavier

  4. #4
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    I can't believe there is no possibility to choose '% Of' SUBTOTAL (instead of TOTAL). That's a shitty move!
    I agree.... but I have not found a solution to this.

    I have made a workaround that might help you get the percentages you want but it involves a column with formula outside the actual pivot table, and I can agree if you think this is a bit dirty, but it works....

    Put this in E7 and copy down as far as you think your pivot tabel can expand.

    =IF(B7="","",D7/VLOOKUP("*Total",A7:D100,4,FALSE))

    I have attached your sheet with the colum added.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-13-2007
    Posts
    5
    It does work...and I guess I'll have to use it.

    Can't anyone tell Bill Gates about this and tell me to come here and fix this?!

    Thank you,

    xavier

  6. #6
    Registered User
    Join Date
    06-07-2005
    Posts
    3

    More ideas?

    As I have exactly the same problem - I thought maybe sb knows how to overcome it differently; maybe still within pivot itself?

    Aga

  7. #7
    Forum Contributor
    Join Date
    01-23-2006
    Posts
    194
    You can do it in a pivot table with some helper columns.
    see attachment.
    regards
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-04-2009
    Location
    OC, CA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    You're a genius Steve. Thanks a ton.

  9. #9
    Registered User
    Join Date
    06-17-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    Hey Steven 101,
    I was wondering how you were able to create that "helper colunm" or the extra field called MyTotal. How did you code it?
    I tried seeing if there was a formula attached to it, but i couldn't find anything.

    Thanks,

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    Welcome to the forum, incognitos.

    Please take a few minutes to read the forum rules, and then start your own thread.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Registered User
    Join Date
    10-27-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    Quote Originally Posted by steven1001 View Post
    You can do it in a pivot table with some helper columns.
    see attachment.
    regards
    This is an excellent solution. Quite helpful. Thanks

  12. #12
    Registered User
    Join Date
    01-12-2010
    Location
    Everett, WA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    Thank you so much- this was a very clear method for something I have been struggling with for a while

  13. #13
    Registered User
    Join Date
    05-15-2010
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Pivot Table: adding a percentage field as '% of Subtotal'

    hi its nice solution but is too long for more complex database

Closed Thread

Thread Information

Users Browsing this Thread

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

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