LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default ABS <= and logic functions

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a word in logic functions (instead of a number) hillan2 Excel Worksheet Functions 2 January 14th 09 11:54 PM
How do I set two different (AND & OR) logic functions within one Short Term Trader Excel Discussion (Misc queries) 1 January 19th 07 08:37 PM
How do I set two different (AND & OR) logic functions within one Teethless mama Excel Discussion (Misc queries) 0 January 19th 07 08:22 PM
How do I set two different (AND & OR) logic functions within one John Bundy Excel Discussion (Misc queries) 0 January 19th 07 08:13 PM
logic (IF) functions elaine Excel Worksheet Functions 4 June 23rd 06 02:30 AM


All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"