View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Chris Chris is offline
external usenet poster
 
Posts: 788
Default problem with round down

Thanks Joe. That worked. I had already looked at the original number out to 8
decimal places and found no difference. After reading your post I had to take
it out to 16 places for the difference to show. Strange.

"JoeU2004" wrote:

"Chris" wrote:
If my number is 0.3020 i want to return 0.302, but I keep getting 0.301


Try:

=rounddown(round(A1,4),3)

Explanation....

When you format a number with 4 decimal places, the displayed value is
rounded. So 0.3020 is probably significantly less. You might be able to
verify that by formatting that cell to 15 decimal places. But sometimes,
even that is not good enough to see the difference.


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


"Chris" wrote in message
...
I want to round a number down to three decimal places and have tried
rounddown, floor and trunc but I keep getting an unintended result in the
following situation:

If my number is 0.3021 i want to return 0.302
If my number is 0.3027 i want to return 0.302
If my number is 0.3020 i want to return 0.302, but I keep getting 0.301

All of these give me 0.301 when the fourth decimal place is a zero.
ROUNDOWN(cell,3)
FLOOR(cell,0.001)
TRUNC(cell,3)