+ Reply to Thread
Results 1 to 16 of 16

Rounding values to 2 decimel while keeping total 100%

  1. #1
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Rounding values to 2 decimel while keeping total 100%

    In the attached file the values in column K ("Unique value %) should be rounded to 2 decimel but the "Total %" in column L should still stay exactly 100%.
    So I can't use directly the ROUND function, as it messes up the 100 value, like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But is there a way to propotionally add/remove value to round the numbers to 2 decimel and keep the total value 100?

    The formulas in J,K,L columns are there all thanks to member Estevaoba

    Also there could be an instance where there are 3 values all 33,333333%. So rounding them to 100 could be an issue. Right?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    498

    Re: Rounding values to 2 decimel while keeping total 100%

    Just use a helper column which you can hide away/group shut.
    This keeps it plain and simple and auditable.

    Another possibility would be that you simply format column K to only show 2 decimals (but this retains the underlying exact values and removes your 100% aggregation problem).

  3. #3
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    Formatting the column K doesn't solve the problem here really. Sure, it shows only 2 decimal place, but the others still exist - they just don't show.
    But I need to round the column K so, that the Total is still 100. Not 100,01 or 101,02 etc

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    498

    Re: Rounding values to 2 decimel while keeping total 100%

    You can't expect to round intermediate results and pretend the onward calculations to ignore that, unless you're willing to also round the end-result then.

    As I wrote before, use a helper column as you want essentially two separate calculations.

  5. #5
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    Still having trouble with this.
    If I use this formula to ROUND the values in column K to 2 decimal places the first sum is 100,01, but needs to be exactly 100.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So what kind of other helper column could I use to have the total of 100?
    As the data in column K could sum to 100,5 etc as well. And I can't just substract whatever is over 100 from the total sum.

  6. #6
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,987

    Re: Rounding values to 2 decimel while keeping total 100%

    Could you use a Min function in the total column to return 100 for anything over that?

    =IF(K2="";"";IF(COUNTIFS(K$2:K2;">0";E$2:E2;E2)=SUM(--(FILTER($J$2:$J$50000;($J$2:$J$50000>0)*($E$2:$E$50000=E2);0)<>""));MIN(SUM(K$2:K2)/(1+COUNTIF(L$1:L1;">0"));100);""))

  7. #7
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    Thank You! It does work for the Total column of 100, but I'd still have to somehow make the column K equal to 100 as well.
    As RaulSerg pointed out, I'd have to use some helper columns, but at the moment I don't have the slightest clue of the process.

    Is it possible to evenly add or substract what ever is necessary for the sum of one client, so the column K (or newly created helper column) equals 100?
    So if the total in column L for client AGA is 100,01 - I'd have to substract 0,1 from one value in column K.

    Sorry, if I'm getting too confusing with this :D

  8. #8
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,987

    Re: Rounding values to 2 decimel while keeping total 100%

    What about putting the min in column K?

    =IF(J2="";"";MIN(J2/SUM(FILTER($J$2:$J$50000;($J$2:$J$50000>0)*($E$2:$E$50000=E2)))*100;100))

  9. #9
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    Nope, or did work, but not if I tried ROUNDing the formula. Then I'd still get 100,01.

  10. #10
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    How could I make a helper column to distribute difference proportionally among the values in column K?

  11. #11
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    So I created a new worksheet with some data. The original worksheet has many-many more rows. But I chose those three.
    Also started with a helper column S, but have no idea how to continue from there on...


    The problems are:

    1.The column M should equal 100 for each client, but ALS has only one value in one month. But the calculation still gives 100 for it.
    So there's something wrong with the formula?

    2. Client UMM has a total of 100,08 in column P, so the excess 0,08 should be distributed between the values of client UMM in column P.

    3. Client VAU has a total of 99,99, so 0,01 should be somehow added to one value in column P.

    It should continue with extra helper columns, but what should be the next one then?
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,216

    Re: Rounding values to 2 decimel while keeping total 100%

    The easiest way is to add/subtract from the last value associated with a client. Spreading very small differences (0.08) between 100 of UMM is not viable.
    Last edited by JohnTopley; 04-16-2024 at 04:29 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  13. #13
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    It's necessary for the accounting, so that's why it has to be rounded to 2 decimal places and total sum has to be exactly 100% and in this worksheet the column P (or any other column associated with column P) has to eventually be 100

  14. #14
    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,990

    Re: Rounding values to 2 decimel while keeping total 100%

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    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.

  15. #15
    Registered User
    Join Date
    11-01-2023
    Location
    Tallinn, Estonia
    MS-Off Ver
    MS Excel 365
    Posts
    60

    Re: Rounding values to 2 decimel while keeping total 100%

    Guess I haven't read the rules so thoroughly.

    The link to other forum: https://www.mrexcel.com/board/thread...l-100.1257377/

  16. #16
    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,990

    Re: Rounding values to 2 decimel while keeping total 100%

    You have now! Thank you.

+ 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] Rounding up a decimel number to a whole number
    By Gunner 14 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-27-2012, 03:21 AM
  2. Replies: 1
    Last Post: 02-14-2011, 04:59 PM
  3. keeping a bank total
    By grentech in forum Excel General
    Replies: 2
    Last Post: 09-30-2010, 10:13 PM
  4. mail merge rounding decimel places
    By CaptainMortgage in forum Excel General
    Replies: 2
    Last Post: 07-30-2007, 07:19 PM
  5. [SOLVED] KEEPING THE TOTAL IN C3 WHEN ADDING B3
    By bouncer8 in forum Excel General
    Replies: 3
    Last Post: 08-18-2006, 08:25 PM
  6. [SOLVED] Keeping an acculumative total in a row and only that row.
    By Sherry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2006, 04:40 PM
  7. Keeping a running total
    By Simbo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2005, 03:55 PM
  8. Keeping a running total
    By Simbo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2005, 03:39 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