INT Function Returns 1

B

Bhavesh

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
 
S

SteveW

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
 
M

Martin Fishlock

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top