Round to the nearest 5 cent

F

Foxtrojan

Please help. If my value is $0.04 and below then round down to $0.00. If the
value is $0.05 then return the same value. If it is $0.06 and above then
return a value of $0.10.

Thanking you
 
K

Ken Snell [MVP]

Here's one (of many) way to do it:

RoundedValue = MyValue-(IIf((MyValue-Fix(MyValue))*100 Mod
10<5,(MyValue-Fix(MyValue))*100 Mod 10,IIf((MyValue-Fix(MyValue))*100 Mod
10=5,0,(MyValue-Fix(MyValue))*100 Mod 10-10))/100)
 
Top