Reputation: 21
Can anyone help me with a formula that roundups up a number only if it ends with .4 or more, otherwise it should stay as it is.
Eg. 1.4 rounds to 2 ; 2.5 rounds to 3 ; 2.3 stays at 2.3
Perhaps i should also mention that the number that needs rounding may sometimes have more than 1 decimal place
Hopefully this is clear enough
Upvotes: 0
Views: 3376
Reputation: 10019
I believe this is what you're after.
Formula
=IF(LEN(A1)>2,IF(NUMBERVALUE(MID(A1,FIND(".",A1)+1,1))>3,ROUNDUP(A1,0),A1),A1)
Explanation
LEN(A1)>2
Check if cell is 3 characters or more. Whole numbers are 1, so ignore themMID(A1,FIND(".",A1)+1,1)
- Find the character to the right of the decimal point. Returns text..NUMBERVALUE(...)>3
- Convert that text, and check it is greater than 3.ROUNDUP(A1,0)
- Only if that is true, round up the number. Otherwise return it as it is.Example
Upvotes: 0