View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Joe User[_2_] Joe User[_2_] is offline
external usenet poster
 
Posts: 905
Default OR function produces incorrect result

"Joe User" <joeu2004 wrote:
Obviously, you have made a mistake.
But what that mistake is is anyone's guess.


I forgot the most obvious one: D3 only __appears__ to be 3 due to
formatting, but the actual numeric value is something else.

D3 might contain a date and/or time that you formatted to display only the
month number, day number, year of the century, hours, minutes or seconds.

Or D3 might contain a number with a decimal fraction that you format with
zero decimal places.

Or D3 might contain a number larger than 1000 that you formatted to display
only the thousands.

Finally (although I might have overlooked others)....


3. You misrepresented the facts: D3 is not 3.


Perhaps D3 contains 3% (0.03) that you are describing as 3.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"MZ" wrote:
I am testing the "OR" function and it seems to produce a false
result even when only one of two logical arguments is false

[....]
Cell D2 is 50
Cell D3 is 3
=IF(OR(D2=6,D3=3),"OK","No good")


Obviously, you have made a mistake. But what that mistake is is anyone's
guess. My guesses:

1. One or both of the contents of D2 and D3 are text, not numeric. What
does TYPE(D2) and TYPE(D3) return?

or

2. You have not copy-and-pasted the formula verbatim from the Formula Bar
into your message, and you have an error in your formula that is not
apparent in your message because you subconsciously corrected the error
when you retyped the formula.

or

3. You misrepresented the facts: D3 is not 3.


----- original message -----

"MZ" wrote in message
...
I am testing the "OR" function and it seems to produce a false result even
when only one of two logical arguments is false (that is, it is acting
like
the AND function that requires all arguments to be true).

Here is the formula I wrote:

Cell D2 is 50
Cell D3 is 3

=IF(OR(D2=6,D3=3),"OK","No good")

The result is "No good" even though the second argument is true.


--
MZ