+ Reply to Thread
Results 1 to 18 of 18

Round up and down in same formula

Hybrid View

  1. #1
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Round up and down in same formula

    Hello everyone
    Does anyone know if this rounding is possible within same formula:
    If my numbers are
    1.62 round down to 1.60
    1.65 keep same 1.65
    1.67 round up to 1.7

    Thanks for help !!

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    What if it's 1.66?

    Typically you'd use MROUND to round to nearest multiple. But in this case you can't use it, since it will round down 1.67 to nearest multiple of 0.05 (i.e. 1.65).

    It's best, if you can give multiple example and expected return that captures your logic.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    Thank you for reply, here is what exactly I am hoping for
    if 1.61 = round to 1.60
    1.62 = 1.60
    1.63 = 1.60
    1.64 = 1.60
    1.65 = 1.65
    1.66 = 1.70
    1.67 = 1.70
    1.68 = 1.70
    1.69 = 1.70

    Hope this helps!!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    May be...
    =IF(RIGHT(TEXT(A2,"0.00"),1)="5",A2,ROUND(A2,1))

  5. #5
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    It works,
    You are Genius!!
    Thank you very much for your help.
    Appreciate it.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    You are welcome.

    Just a note, text conversion was used here, as decimal conversion often causes floating point error and will result in inconsistent result.

    If you are satisfied with the solution provided. Please mark the thread as solved by using thread tools found at top of your initial post.

  7. #7
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    Thank you again,
    last question on this
    What will be formula for this
    if 1.61 = round to 1.65
    1.62 = 1.65
    1.63 = 1.65
    1.64 = 1.65
    1.65 = 1.65
    1.66 = 1.70
    1.67 = 1.70
    1.68 = 1.70
    1.69 = 1.70

  8. #8
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    And formula for
    if 1.61 = round to 1.60
    1.62 = 1.60
    1.63 = 1.60
    1.64 = 1.60
    1.65 = 1.65
    1.66 = 1.65
    1.67 = 1.65
    1.68 = 1.65
    1.69 = 1.65
    Really appreciate your help

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    For that you can just use Ceiling.Math function.

    Ex:
    =CEILING.MATH(A2,1/20)

    EDIT: Oh wait. I misread. Should be FLOOR.MATH
    =FLOOR.MATH(A2,1/20)

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,382

    Re: Round up and down in same formula

    The first looks like a CEILING() function. =CEILING(number,0.05)

    The second looks like a FLOOR() function. =FLOOR(number,0.05).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  11. #11
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    @MrShorty

    Ya, I realized that when I was looking at his second question

    Edit: Oh wait, didn't see another post he made. That confused me :p
    Last edited by CK76; 07-30-2020 at 01:34 PM.

  12. #12
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    Thank you both of you.
    Is there a way I can manipulate this formula you gave me earlier to get following?
    Formula = =IF(RIGHT(TEXT(A2,"0.00"),1)="5",A2,ROUND(A2,1))

    Result I expect is
    1.61= 1.60
    1.62= 1.60
    1.63= 1.60
    1.64= 1.60
    1.65= 1.65
    1.66= 1.65
    1.67= 1.65
    1.68= 1.65
    1.69= 1.65
    1.70= 1.70

  13. #13
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    Isn't that same as your post #8?

    For post#7 use CEILING.MATH
    For post#8 use FLOOR.MATH

    Only reason I had to use Text function was because of special treatment of x.x5 in your original question.

  14. #14
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    And it worked perfectly fine with my first scenario.

  15. #15
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    For some reason its not working not sure what am I doing wrong
    my value is
    1.649 and to two decimal places it is 1.50 and I apply formula =floor.math(A1,0.05) and result it gives me is 1.60 instead it should be 1.65

  16. #16
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Round up and down in same formula

    1.649 is less than 1.65 so it will evaluate to 1.60 using FLOOR.MATH

    You need to first ROUND(Value,2) then nest it in FLOOR.MATH.

    But, I'd recommend adding helper column. Rather than doing it in single cell. To visually check that intermediate value is indeed what you expected.

  17. #17
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Round up and down in same formula

    Sounds like you want to round first to 2 decimals and then do your custom rounding. SO
    Formula: copy to clipboard
    =FLOOR.MATH(ROUND(A2,2),1/20)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  18. #18
    Registered User
    Join Date
    07-30-2020
    Location
    Edmonton, Alberta, Canada
    MS-Off Ver
    365
    Posts
    9

    Re: Round up and down in same formula

    You guys are awesome, thank you very much for all the help.
    I got everything working now.
    I will mark the thread solved.
    Cheers!!

+ 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] How to PRESENT round-down, but not perform round-down function?
    By superlative in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-02-2019, 12:06 PM
  2. [SOLVED] Custom formulas that will round up when a condition is met or round down
    By cinstanl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-20-2016, 01:32 PM
  3. Replies: 1
    Last Post: 09-04-2015, 04:06 PM
  4. Replies: 2
    Last Post: 12-06-2014, 01:58 PM
  5. [SOLVED] How to round to nearest .01 and round down if thousands place is .005
    By dredre609 in forum Excel General
    Replies: 5
    Last Post: 09-29-2014, 11:47 AM
  6. round up round down formula
    By m_789 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2014, 05:34 AM

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