+ Reply to Thread
Results 1 to 3 of 3

Rounding up/down of variables

  1. #1
    Registered User
    Join Date
    03-17-2013
    Location
    Saskatoon, Saskatchewan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Rounding up/down of variables

    As we are about to lose the penny in Canada, I need to know how to round up or down invoice amounts, which appear in, say, cell C25, i.e. =SUM(B5:B15). If the sum is $xx.01, or $xx.02, $xx.11 or $xx.12, etc., then the sum should be rounded down to $xx.00 or $xx.10, etc. If the sum is $xx.03 or $xx.04, $xx.13 or $xx.14, etc., then the sum should be rounded up to the next nickel. This I have accomplished by using CEILING, the problem is that the sums are always rounded up. Rounding down I have accomplished too, but the headache is with the in-between values, i.e.
    If the sum in C25 equals 12.01 or 12.02 then the sum in C25 is 12.00, otherwise (else) the sum is 12.05.
    If the sum in C25 equals 31.11 or 31.12 then the sum in C25 is 31.10, otherwise (else) the sum is 31.15. etc.

    I don't know how to represent the variable in C25 and compare it with an unknown reference.

    Any help or suggestion is greatly appreciated.
    Thank you.
    Quique

  2. #2
    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/down of variables

    use mround
    =mround(c25,0.05)
    "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

  3. #3
    Registered User
    Join Date
    03-17-2013
    Location
    Saskatoon, Saskatchewan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Rounding up/down of variables

    Quote Originally Posted by martindwilson View Post
    use mround
    =mround(c25,0.05)
    Thank you very much for the help. As I look at the function, it seems sooo easy. It is exactly what I needed. The headache is gone and the "Aspirin" is back in the med cabinet. Now I have to figure out how to close the thread (I am a one-day newbie).

    Again, thank you very much.

    Quique

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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