Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
mz mz is offline
external usenet poster
 
Posts: 40
Default OR function produces incorrect result

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 905
Default OR function produces incorrect result

"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


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,276
Default OR function produces incorrect result

Hi,
The formula is correct and works fine, check if the number in D3 is not
formated as a text

"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 (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

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,203
Default OR function produces incorrect result

As Eduardo said, more than likely D3 is formatted as text. A quick test:
change your formula to
=IF(OR(D2=6,D3="3"),"OK","No Good")
if you get OK, then D3 is definitely formatted as text or the number has a
single apostrophe in front of it, forcing it to be treated as text.

"Eduardo" wrote:

Hi,
The formula is correct and works fine, check if the number in D3 is not
formated as a text

"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 (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

  #5   Report Post  
Posted to microsoft.public.excel.newusers
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



Reply
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
Incorrect result using NPER worksheet function KG Old Wolf Excel Worksheet Functions 7 November 3rd 08 02:49 AM
IF function returning incorrect result Hillary E. Excel Worksheet Functions 2 August 22nd 06 05:43 PM
RSQ function gives incorrect result imurch Excel Worksheet Functions 1 November 4th 05 01:35 PM
Copy Paste of Formula Produces Incorrect Result JLa Excel Discussion (Misc queries) 1 May 17th 05 06:56 PM
Using Min function with cells in a Row returns incorrect result. Gaurav New Users to Excel 2 March 7th 05 01:01 PM


All times are GMT +1. The time now is 07:53 PM.

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

About Us

"It's about Microsoft Excel"