+ Reply to Thread
Results 1 to 3 of 3

Rounding with exception

  1. #1
    Registered User
    Join Date
    08-03-2009
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Rounding with exception

    Hi again,

    Nice to be back, I have one question which do need help. My problem is that, I wish to round all values in cell into the nearest 5. Let say 4.9 should be round as 5, 72 as 70 but 0 should be maintain as 0. There's also exception whereas anything that is greater than 0 such as 0.1,0.2,1.0 etc these values should be as 5.

    Is there anyway to accomplish this? please help...

    Thank you

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Rounding with exception

    =IF(AND(A1>0,A1<2.5),5,ROUND(A1/5,0)*5)

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    08-03-2009
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Rounding with exception

    Quote Originally Posted by Domski View Post
    =IF(AND(A1>0,A1<2.5),5,ROUND(A1/5,0)*5)

    Dom
    Hi Dom, thanks for the solution, do help me a lot in looking for the solution. AS my column in percent and any value will automaticllay multiply by 100. Does this formula can be applied to your previous solution? It came out somthing like invalid formula

    Formula for precentage column:
    =IF(AND(A1>0,A1<2.5),5,ROUND(A1/5,0)*5)/100

    Thank you again

+ 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