+ Reply to Thread
Results 1 to 10 of 10

Percentage in Subtotals

  1. #1
    Registered User
    Join Date
    02-10-2022
    Location
    Belgrade
    MS-Off Ver
    EXCEL 2007
    Posts
    5

    Percentage in Subtotals

    Hello,
    I have a Pivot table and I need to calculate percent change between two columns, showing result in third one.
    I have made a Calculated Item and works ok, except in subtotals and gandtotals. There it gives the error div/0, although the subtotals which i want to compare are more than zero.
    How can i solve it?
    Thanks

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Percentage in Subtotals

    Hi,

    Can you post a workbook with a small, mocked-up example?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    02-10-2022
    Location
    Belgrade
    MS-Off Ver
    EXCEL 2007
    Posts
    5

    Re: Percentage in Subtotals

    Yes, of course. There is a simple example of table, where there are errors in cells where perantage of subtotals should be calculated (procent of gain/price) Below is the way I would like it to look like.
    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Percentage in Subtotals

    Thanks,

    You have some entries for which the 'plan' entry is zero, e.g. January|West|store 1|glasses, which causes a #DIV/0! result. This error is then passed on to the subtotals/totals.

    Regards
    Last edited by XOR LX; 02-10-2022 at 04:11 PM.

  5. #5
    Registered User
    Join Date
    02-10-2022
    Location
    Belgrade
    MS-Off Ver
    EXCEL 2007
    Posts
    5

    Re: Percentage in Subtotals

    Yes, but it is the case in reality, with real datas.
    Thanks

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Percentage in Subtotals

    You're not going to be able to do this with a Calculated Item.

    If you add two additional columns to your source data, called 'Sold' and 'Plan', in columns H and I respectively, with these formulas:

    H2 (Sold):

    =IF(A2="sold",D2,0)

    and copied down.

    I2 (Plan):

    =IF(A2="plan",D2,0)

    and copied down.

    Then adjust the Pivot Table source data so that it includes these two new columns. After which you can create a Calculated Field (not Item) with the formula:

    =Sold/Plan

    Regards

  7. #7
    Registered User
    Join Date
    02-10-2022
    Location
    Belgrade
    MS-Off Ver
    EXCEL 2007
    Posts
    5

    Re: Percentage in Subtotals

    Hello,
    I am so sorry that I have to write again.
    I cant use that formula which you have wrote. There is message that something is wrong with it.
    Thank you very much.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Percentage in Subtotals

    Replace commas with semi-colons for your locale:

    =IF(A2="sold";D2;0)

    =IF(A2="plan";D2;0)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    02-10-2022
    Location
    Belgrade
    MS-Off Ver
    EXCEL 2007
    Posts
    5
    Thank you very much,
    Best regards!
    Last edited by AliGW; 02-11-2022 at 07:30 AM. Reason: PLEASE don't quote unnecessarily!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Percentage in Subtotals

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. [SOLVED] Find subtotals for three separate items and place all subtotals at bottom of all the data
    By skylinekiller in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-09-2019, 09:22 AM
  2. Replies: 1
    Last Post: 11-22-2015, 08:35 AM
  3. Pivot Table Problem Percentage of Subtotals
    By Swindon in forum Excel General
    Replies: 4
    Last Post: 05-25-2010, 08:43 AM
  4. Pivot table subtotals expressed as a percentage
    By nathan_t in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2009, 06:21 PM
  5. subtotals, percentage charts, multiple sheets
    By rini247bini in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-18-2008, 03:12 AM
  6. How to calculate percentage of values of subtotals
    By Alicia in forum Excel General
    Replies: 5
    Last Post: 02-15-2006, 10:10 AM
  7. [SOLVED] Problem with nested subtotals, placing secondary subtotals BELOW .
    By Dawn Cameron in forum Excel General
    Replies: 1
    Last Post: 06-03-2005, 06:05 PM

Tags for this Thread

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