INT Function Returns 1
Hi
I have this odd problem with INT function returns 1, when it needs to return 2. i have a cell (M10) value £0.04 based on a formula =$B3-SUMPRODUCT(($C3:L3)*($C$1:L$1)) and cell M11 value 2 based on a formula =M10/M1. The cell M12 =INT(M11) returns 1 but it should return 2 because =Int(2) returns 2 Is anyone can explain me why this happening and what is workaround to fix this issue? If anyone would like have a look at the excel file, then i'm happy email over. Regards Bhavesh |
INT Function Returns 1
First are you sure that M11 is 2 ?
If it was 1.99 then it could display as 2 In this case INT(1.99) is 1 The trick is to add a small decimal value before doing the INT() ie M12=INT(M11+0.1) It is always a good idea to have an idea of what the actuall values are going to be when using INT(). You should have some idea of what INT() on 1.4, 1.5 1.9 etc should return. A different way is to ROUND() the value of M11, it depends on what your values are in M11, and what you want to do :) Steve On Fri, 29 Dec 2006 10:24:00 -0000, Bhavesh wrote: Hi I have this odd problem with INT function returns 1, when it needs to return 2. i have a cell (M10) value £0.04 based on a formula =$B3-SUMPRODUCT(($C3:L3)*($C$1:L$1)) and cell M11 value 2 based on a formula =M10/M1. The cell M12 =INT(M11) returns 1 but it should return 2 because =Int(2) returns 2 Is anyone can explain me why this happening and what is workaround to fix this issue? If anyone would like have a look at the excel file, then i'm happy email over. Regards Bhavesh |
INT Function Returns 1
Hi Bhavesh
You may find that 2 is not really 2 but 1.99999999999 and it is rounded for the display. You could try expanding the format to 0.000000000000000000 to see what you get or do the following: [M11]=round(m10/m1,2) and see what the answer is. -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "Bhavesh" wrote: Hi I have this odd problem with INT function returns 1, when it needs to return 2. i have a cell (M10) value £0.04 based on a formula =$B3-SUMPRODUCT(($C3:L3)*($C$1:L$1)) and cell M11 value 2 based on a formula =M10/M1. The cell M12 =INT(M11) returns 1 but it should return 2 because =Int(2) returns 2 Is anyone can explain me why this happening and what is workaround to fix this issue? If anyone would like have a look at the excel file, then i'm happy email over. Regards Bhavesh |
INT Function Returns 1
What does =(M11-2) return?
My guess is that it will be negative, indicating that INT is working properly. What does =(M10-0.04) return? What does =(M1-0.02) return? Note that the parentheses in these formulas should be used to prevent Excel from being overly "helpful". Without the parentheses, Excel might hide the information that is needed in this instance. Jerry "Bhavesh" wrote: Hi I have this odd problem with INT function returns 1, when it needs to return 2. i have a cell (M10) value £0.04 based on a formula =$B3-SUMPRODUCT(($C3:L3)*($C$1:L$1)) and cell M11 value 2 based on a formula =M10/M1. The cell M12 =INT(M11) returns 1 but it should return 2 because =Int(2) returns 2 Is anyone can explain me why this happening and what is workaround to fix this issue? If anyone would like have a look at the excel file, then i'm happy email over. Regards Bhavesh |
All times are GMT +1. The time now is 09:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com