+ Reply to Thread
Results 1 to 17 of 17

Rounding up to the nearest .33

  1. #1
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    155

    Rounding up to the nearest .33

    I have a list of numbers that I need to add up. I am using the sum function and then want to round up to the nearest .33 increment. With that said, the last two digits need to be .33, .66, or .99. When I do the sum function, with a round to two digits and then take the right two numbers, it will not always work because if its an even number like .4, it will not show .40 and therefore doing if statements to the right two numbers wont work.

    Any suggestions?

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Rounding up to the nearest .33

    How about....

    =INT(((ROUND(SUM(A1:A10)*3,0)-0.01)*100)/3)/100

    .....assuming the data is in A1:A10
    Martin

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

    Re: Rounding up to the nearest .33

    "How about....

    =INT(((ROUND(SUM(A1:A10)*3,0)-0.01)*100)/3)/100
    "

    What about the rounding up bit?

    Maybe:

    =SUMPRODUCT(CEILING(MOD(SUM(A1:A10),{1000,1}),{1,0.33}))-1

    Regards
    Click * below if this answer helped

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

  4. #4
    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,946

    Re: Rounding up to the nearest .33

    What about using...
    =MROUND(sum(....),1/3)
    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

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

    Re: Rounding up to the nearest .33

    "What about using...
    =MROUND(sum(....),1/3)
    "

    I thought about that, but after 0.33, 0.66, 0.99, ... you'll start rounding to 1.32, 1.65, 1.98, etc. and it just gets further and further away...

  6. #6
    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,946

    Re: Rounding up to the nearest .33

    Not from what I had...maybe Im missing something?
    B
    C
    10
    1.5
    1.666667

    C10=MROUND(B10,1/3)

    edit: OK so that will give 1.67, not 1.66 if only 3 dec shown, so then this instead...
    =ROUNDDOWN(MROUND(B10,1/3),2)

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

    Re: Rounding up to the nearest .33

    Ah, no. Of course, you're using a 1/3, not 0.33!

    Apologies, and very nice! Ok, so now you just have to do something about unwanted rounding, e.g.
    what do you get if B10 has, say, 98.93?

    Cheers

    Edit: In fact, even though it will take a while before using a third will start to lose accuracy, it will happen...e.g. if B10 has 1000.1, the desired answer is 1000.33, yet your formula will give 1000.
    Last edited by XOR LX; 02-16-2014 at 05:48 PM.

  8. #8
    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,946

    Re: Rounding up to the nearest .33

    Hmm using that, I get 99.00 needed to add some stuff...
    =IF(MOD(ROUNDDOWN(MROUND(B10,1/3),2),1)=0,ROUNDDOWN(MROUND(B10,1/3),2)-0.01,ROUNDDOWN(MROUND(B10,1/3),2))

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Rounding up to the nearest .33

    what about say 2 that rounds to 2 shouldnt it be 1.9999?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: Rounding up to the nearest .33

    But now your previously concise, elegant solution is longer than mine!

    (And I'm still not sure it work for sufficiently large numbers, e.g. 1000.1 is rounded down to 999.99 in your latest version.)

    Regards

  11. #11
    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,946

    Re: Rounding up to the nearest .33

    lol Yes, I know. Thats what happens when you get more complex. Maybe we need more input from the OP

    @ martin, thats what my addition was for

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

    Re: Rounding up to the nearest .33

    Had to amend my solution slightly to account for cases where the sum is an integer:

    =SUMPRODUCT(CEILING(MOD(SUM(A1:A10)+10^-10,{1000,1}),{1,0.33}))-1

    Cheers

  13. #13
    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: Rounding up to the nearest .33

    =int(a1) + lookup(mod(a1, 1), {0,34,67}/100, {33,66,99}/100)
    Entia non sunt multiplicanda sine necessitate

  14. #14
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Rounding up to the nearest .33

    I extended the formula of shg............
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  15. #15
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: Rounding up to the nearest .33

    Extended the formula a little bit more................
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    06-27-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Rounding up to the nearest .33

    Old thread, but replies helped me get to a similar desired output:

    =MROUND((A1+0.16),1/3)

    rounds up A1 to 0.00 , 0.33 or 0.67

  17. #17
    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,946

    Re: Rounding up to the nearest .33

    Quote Originally Posted by ejfick View Post
    Old thread, but replies helped me get to a similar desired output:

    =MROUND((A1+0.16),1/3)

    rounds up A1 to 0.00 , 0.33 or 0.67
    Thanks for the feedback, Im happy you found some assistance here

+ 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. rounding down to nearest 10
    By Alex01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2014, 08:53 AM
  2. Rounding to the nearest 5
    By Redder Lurtz in forum Excel General
    Replies: 6
    Last Post: 01-27-2011, 06:45 AM
  3. Rounding to the nearest 9
    By perrybarnett in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-22-2010, 05:48 PM
  4. Rounding up to the nearest 0.99
    By seaniexxx in forum Excel General
    Replies: 5
    Last Post: 01-20-2009, 11:47 AM
  5. Rounding Down to Nearest 1/8
    By L.sean9 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2008, 08:29 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