In meteorology it is the custom to round decimal numbers ending in .5 to the odd. For instance 2.55 becomes 2.3, while 2.35 also becomes 2.3. In Excel they are always rounded up, does anyone know a formulae that will correct this so that they are 'thrown' to the odd.
TIA
Lonnie
Jerry W. Lewis - 25 Jul 2007 12:26 GMT
Rounding is a bit tricky. Computers do binary math which complicates
identifying numbers whose decimal fractions exactly end in 5, since most such
decimal fractions have no exact binary representation and must be
approximated. As a result, a single worksheet formula is unlikely to perform
as expected in every instance. If you can deal with a user defined function
written in VBA (you can call it from worksheet cells as though it was a
worksheet function), then the one that I posted at
http://groups.google.com/group/microsoft.public.excel.programming/msg/0d2dc7c322
cf4b3f
should do the trick.
Jerry
> In meteorology it is the custom to round decimal numbers ending in .5 to the odd. For instance 2.55 becomes 2.3, while 2.35 also becomes 2.3. In Excel they are always rounded up, does anyone know a formulae that will correct this so that they are 'thrown' to the odd.
> TIA
[quoted text clipped - 3 lines]
> ------= Binary Usenet downloading made easy =---------
> -= Get GrabIt for free from http://www.shemes.com/ =-
CLR - 26 Jul 2007 13:10 GMT
This may point some direction.....
=IF(ISEVEN(MID(A1,FIND(".",A1,1)+1,1)),ROUNDUP(A1,1),ROUNDDOWN(A1,1))
BTW, what criteria do you use to ROUND 2.55 to 2.3?
Vaya con Dios,
Chuck, CABGx3
> In meteorology it is the custom to round decimal numbers ending in .5 to the odd. For instance 2.55 becomes 2.3, while 2.35 also becomes 2.3. In Excel they are always rounded up, does anyone know a formulae that will correct this so that they are 'thrown' to the odd.
> TIA
[quoted text clipped - 3 lines]
> ------= Binary Usenet downloading made easy =---------
> -= Get GrabIt for free from http://www.shemes.com/ =-