Rounding Issue

D

DS

This formula below returns 16
I need it to return 17
In other words I want it to round up instead of down
Any suggestions appreciated.
Thanks
DS

=Round([Text0]*0.0825,2)
 
A

Allen Browne

Int() always rounds down. You can use that to round up by negating the
number, using Int(), and negating the result.

Try:
= - Int( - [Text0] * 0.0825)
 
D

DS

Allen said:
Int() always rounds down. You can use that to round up by negating the
number, using Int(), and negating the result.

Try:
= - Int( - [Text0] * 0.0825)
Didn't work. It gave an answer of 1.00 where text0 = 2.00
The correct answer should have been .17
Thanks
DS
 
J

Jackie L

You could try
Int((([Text0]*.0825)+.005)*100)/100



DS said:
Allen said:
Int() always rounds down. You can use that to round up by negating the
number, using Int(), and negating the result.

Try:
= - Int( - [Text0] * 0.0825)
Didn't work. It gave an answer of 1.00 where text0 = 2.00
The correct answer should have been .17
Thanks
DS
 
D

DS

LGC said:
-(int(-round("2"*8.25,2)))/100

LGC
Thanks, I just tried it. Didn't work but this did.

Function Dollars(Amount)
Dollars = Int(Amount * 100 + 0.5) / 100
End Function

Thank you everyone for your input.
DS
 
D

DS

Jackie said:
You could try
Int((([Text0]*.0825)+.005)*100)/100



:

Allen said:
Int() always rounds down. You can use that to round up by negating the
number, using Int(), and negating the result.

Try:
= - Int( - [Text0] * 0.0825)

Didn't work. It gave an answer of 1.00 where text0 = 2.00
The correct answer should have been .17
Thanks
DS
It Works! Thank You. This also works

Function Dollars(Amount)
Dollars = Int(Amount * 100 + 0.5) / 100
End Function

Thanks,
DS
 
Top