ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Round up or down by set variable (https://www.excelbanter.com/excel-discussion-misc-queries/259999-round-up-down-set-variable.html)

Supe

Round up or down by set variable
 
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.

Luke M[_4_]

Round up or down by set variable
 
=IF(MOD(A2,1)<0.8,ROUNDDOWN(A2,0),ROUNDUP(A2,0))

--
Best Regards,

Luke M
"Supe" wrote in message
...
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.




Mike H

Round up or down by set variable
 
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.


"Supe" wrote:

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.


Joe User[_2_]

Round up or down by set variable
 
"Supe" wrote in message
...
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 -----

"Supe" wrote in message
...
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.




All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com