Reputation: 1397
Whenever the decimal remainder is less than .56 I want to round down (normally decimals between and including 0.50 to 0.55 would round up).
for example:
4,55 rounds down to 4, and
4,56 rounds up to 5
I have a lot of numbers (8,55;13,56;...) Thank you
Upvotes: 0
Views: 998
Reputation: 5360
Interesting way of rounding but there are multiple solutions:
The 'clean' way to do it:
=IF(MOD(4.55; 1) > 0.55; ROUNDUP(4.55;0); ROUNDDOWN(4.55;0))
The short and nasty way to do it
=ROUND(4.55 - 0.06; 0)
Upvotes: 6
Reputation: 9
I really like this answer. This serves the purpose.
=IF(MOD(4.55; 1) > 0,55; ROUNDUP(4.55;0); ROUNDDOWN(4.55;0))
Upvotes: -2
Reputation: 18770
OK, so we first detect whether the decimal is greater than .55, so lets get that (say it's in cell A1). Then we call the appropriate method.
// Get the decimal value, is it greater than 0.55?
if (A1 - INT(A1) > 0.55)
{
RoundUp(A1, 0);
}
else
{
RoundDown(A1, 0);
}
Where the 0 represents that you want to round to 0 decimal places.
Upvotes: 3