When trying to extract the decimal part of a number a really odd thing happens, I will try to explain the simple spreadsheet which displays this odd problem
........A..........B....................C..............D.................E
....................=trunc(A1).......=A1-B1......=C1*10........=trunc(D)
1......22.6......22...................0.6............6..................6
2......22.7......22...................0.7............7..................6............-obviously should be 7 Why would TRUNC(7) = 6
3......22.8......22...................0.8............8..................8
4......22.9......22...................0.9............9..................8............-obviously should be 9
I want to trunc "result D" again in case someone started with a number that included more than the tenths, ie hundreths, thousandths, etc., but it behaves very oddly. If I change the ten multiplier in D to 10.1, the trunc functions correctly. To me this has to be a bug with Excel which is very strange to find in a 2007 product. Has anyone experienced this?
The following reslults are obtained:
0 = 0
.1 & .2 = 1
.3 & .4 = 3
.5 = 5
.6 & .7 = 6
.8 & .9 = 8
To my understanding the INT function always rounds down but the TRUNC function should just remove the fraction portion. Please let me know if there is something about the TRUNC function that I am unaware of.
Bookmarks