Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thanks Jerry and Joe.
The rounding works. The terminating decimal fractions can be avoided by this as well. =IF(ABS(G30*10-F30*10)<=2,"PASS","FAIL") It seems like the best fix for me is to have the criterion one significant digit beyond the input. "Jerry W. Lewis" wrote: Computers work in binary. Most terminating decimal fractions (including .2) have no exact binary representation and hence must be approximated (just as 1/3 can only be approximated as a decimal fraction). In that context, a similar question would be why does =IF(ABS(30.67-30)<=0.6667,"PASS","FAIL") return "FAIL"? It is the same thing, just more obvious in this second problem. Comparisons should allow for some tolerance due to the unavoidable approximatiosn to input numbers. Often this can be effectively handled by simply rounding results before the comparison. Jerry "DrPhil" wrote: I'm having trouble with this function =IF(ABS(G30-F30)<=0.2,"PASS","FAIL") If the numbers in G30 and F30 are bigger than 31 it returs false when equal to 0.2. If I replace the <= with an OR statement it will work for values up to 500. A workaround is to change the criteria to < 0.200000000001 but its not really the same thing. It like some wierd residual significant figures thing. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using a word in logic functions (instead of a number) | Excel Worksheet Functions | |||
How do I set two different (AND & OR) logic functions within one | Excel Discussion (Misc queries) | |||
How do I set two different (AND & OR) logic functions within one | Excel Discussion (Misc queries) | |||
How do I set two different (AND & OR) logic functions within one | Excel Discussion (Misc queries) | |||
logic (IF) functions | Excel Worksheet Functions |