Round up or down by set variable

S

Supe

Is there a way to have a number round up or down based on a threshhold it
hits between the two number? I want a number when it hits .8 to round up,
otherwise round down.

For example 1.8 would round up to 2 but 1.79 would round down to 1
2.8 would round up to 3 but 2.79 would round down to 2, etc.
 
M

Mike H

Hi,

One way

=IF(MOD(A1,1)>=0.8,CEILING(A1,1),INT(A1))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
J

Joe User

Supe said:
I want a number when it hits .8 to round up,
otherwise round down. [....]
For example 1.8 would round up to 2 but
1.79 would round down to 1

Ostensibly:

=rounddown(A1,0) + (mod(A1,1)>=0.8)

But that would round 1.795 down to 1, even though it might display as 1.80
(Number with 2 dp). So I wonder if you would be happier with:

=rounddown(A1,0) + (round(mod(A1,1),2)>=0.8)


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top