+ Reply to Thread
Results 1 to 6 of 6

formula to roundup o rounddown depending on value

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    2

    formula to roundup o rounddown depending on value

    We always order in half-dozens, and I need a formula that will:

    #1: round to 6
    #2: if the number is 1-2 from the integer divisible by 6, then round down
    #3: if the number is 3-5 from the integer divisible by 6, then round up
    (I know, terrible explanation)

    For example if the value is...

    12 - no rounding
    13 - round down to 12
    14 - round down to 12
    15 - round up to 18
    16 - round up to 18
    17 - round up to 18
    18 - no rounding
    19 - round down to 18
    20 - round down to 18
    21 - round up to 24
    etc.

  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: formula to roundup o rounddown depending on value

    Hi,

    Maybe:

    =A1-MOD(A1,6)+6*GESTEP(MOD(A1,6),3)

    Regards
    Click * below if this answer helped

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

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: formula to roundup o rounddown depending on value

    Simply..

    =MROUND(A1,6)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  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: formula to roundup o rounddown depending on value

    Oh yeah!

  5. #5
    Registered User
    Join Date
    09-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    2

    Red face Re: formula to roundup o rounddown depending on value

    Quote Originally Posted by Ace_XL View Post
    Simply..

    =MROUND(A1,6)
    Awesome, this did the trick!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: formula to roundup o rounddown depending on value

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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] Round, Roundup, Rounddown or something else????
    By PERE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2013, 09:14 AM
  2. [SOLVED] ROUNDDOWN & ROUNDUP in same formula?
    By Grasshopper Green in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2013, 08:32 AM
  3. [SOLVED] Rounddown, roundup
    By allan223 in forum Excel General
    Replies: 3
    Last Post: 09-13-2012, 09:44 PM
  4. Excel 2007 : ROUNDUp / ROUNDDOWN
    By johannes in forum Excel General
    Replies: 1
    Last Post: 03-09-2010, 09:59 PM
  5. [SOLVED] Roundup or rounddown
    By Heather in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2005, 10:40 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