I have a cell (A40) in an Excel worksheet which contains the sum of a range of values (formula: =SUM(A1:A39)
).
Another cell should print "OK" if the sum is 0 and "ERROR" if the sum is not 0. I have the following formula: =IF(A40=0;"OK";"ERROR")
. Unfortunately it always prints "ERROR".
A1 to A40 are all in the format "Currency" if that matters.
Is this another "never compare floating points to fixed values, instead use a small epsilon range"-error? The following fix works... =IF(AND(A40>-0,1; A40<0,1);"OK";"ERROR")
. How many zeroes are "enough" to always get the correct "OK" or "ERROR" output?