Forum Home
Press F1
 
Thread ID: 112844 2010-09-24 09:50:00 Weird Excell calc results GrahamB (750) Press F1
Post ID Timestamp Content User
1139333 2010-09-24 09:50:00 Ihave been trying to write a simople formula (the type I have done literally thouisands of times before) and I amd getting absolutely stupid results! I have tried Excell 2000 and rxcel 2007, and both give the same results.

Obviously i had to remove the formuiale here, but A1=0.07, A2=1.93, and A3=2

Set out below are the formulae I have tried, the results I am getting (Left column) and the results i expect (right Column)

0.07
1.93
2
Result Formula Expected Answer
Y =IF((A3-A2)<=0.07,"X","Y") X
0.07 =A3-A2 0.07
FALSE =A3-A2=A1 TRUE
FALSE =(A3-A2)=A1 TRUE
FALSE =A3-A2=A1 TRUE
FALSE =(2-1.93)=0.07 TRUE
TRUE =(2-1.93)>=0.07 TRUE
FALSE =(2-1.93)<=0.07 TRUE


Either I am losing my mental marbles, or there is something weird afoot. Any comments would be appreciated, however if I am am being stupid, then please tell me (relatively) politely!

TFYH

GrahamB
GrahamB (750)
1139334 2010-09-24 11:11:00 I can try it out on my Excel but can you take a screenshot as the formatting of your post is rather confusing :) WarNox (8772)
1139335 2010-09-24 11:15:00 Subtract A2 from A3 again in a separate cell, and then format the result to around 16 decimal places, and you should see the problem.

You can fix this by inserting the ROUND function in there:


=IF(ROUND((A3-A2),0)<=0.07,"X","Y")

Remember that the way Excel calculates numbers isn't necessarily the same way it displays them.
nofam (9009)
1139336 2010-09-25 03:25:00 Thanks nofam. i have done thousands of formulae like this and never encountered that problem in a simple calc.

i was aware of it, and have experienced in multiplication, division and percentage calcs. But you would think by now Microsoft could 'educate' their software better than that!

I hate having to complicate the calc. But i guess getting a result is more important than beating MS's head against a wall!

Many thanks
GrahamB (750)
1