Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mike K
 
Posts: n/a
Default Syntax for 2 AND conditions within an OR function.

Greetings all,

I'm close, I think.
I need to OR two AND conditions. The 60/45 and 12/40 are text formatted

A1 A2
"60/45" AND "Green"
OR
A1 A2
"12/40" AND "Red"

True = YES
False = NO

Thanks Folks!

Mike
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")


"Mike K" wrote:

Greetings all,

I'm close, I think.
I need to OR two AND conditions. The 60/45 and 12/40 are text formatted

A1 A2
"60/45" AND "Green"
OR
A1 A2
"12/40" AND "Red"

True = YES
False = NO

Thanks Folks!

Mike

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

or

=IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

--
HTH

Bob Phillips

"Duke Carey" wrote in message
...
=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")


"Mike K" wrote:

Greetings all,

I'm close, I think.
I need to OR two AND conditions. The 60/45 and 12/40 are text formatted

A1 A2
"60/45" AND "Green"
OR
A1 A2
"12/40" AND "Red"

True = YES
False = NO

Thanks Folks!

Mike



  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Bob Phillips wrote...
or

=IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

....
"Duke Carey" wrote in message
=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")

....

In this particular case concatenation works, but it isn't reliable in
general.

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Harlan,

Are you referring to numbers?

Bob

"Harlan Grove" wrote in message
oups.com...
Bob Phillips wrote...
or

=IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

...
"Duke Carey" wrote in message
=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2=

"Red")),"yes","no")
...

In this particular case concatenation works, but it isn't reliable in
general.





  #6   Report Post  
Harlan Grove
 
Posts: n/a
Default

Bob Phillips wrote...
Are you referring to numbers?

....

No. The result of the concatenation operator, &, is always text.

But the point is that using OR(x&y="foobar",x&y="doodah") when the
fully qualified test is OR(AND(x="foo",y="bar"),AND(x="doo",y="dah"))
can lead to error when, e.g., x = "foob" and y = "ar" or x = "do" and y
= "odah". IOW, x&y=A&B doesn't necessarily give the same result as
AND(x=A,y=B).

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
Use IF function for two conditions wuwu Excel Worksheet Functions 3 April 29th 23 11:42 AM
Can SUMIF function include AND function ShaneS Excel Worksheet Functions 1 May 17th 05 03:24 AM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:29 PM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:12 PM
Count function in excel with different conditions chits Excel Worksheet Functions 1 January 21st 05 07:32 AM


All times are GMT +1. The time now is 02:36 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"