Using AND and OR together

spiffmonkey1

New Member
Joined
Jun 23, 2011
Messages
41
Hi,

I have a column D. I want a cell(D67) to change to "yes" when cells D69,D71,D72 OR D73 equals "yes" AND when D69,D71,D72 OR D73 equals "yes".

So what I have is-
=IF(OR(D69="yes",D71="yes",D72="yes",D73="yes")*AND(OR(D69="yes",D71="yes",D72="yes",D73="yes")*),"yes","no")

Thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Code:
=IF(AND(OR(D69="yes",D71="yes",D72="yes",D73="yes"),OR(D69="yes",D71="yes",D72="yes",D73="yes")),"yes","no")
 
Upvote 0
I dont quite understand but if you want to display yes if two or more cells say yes then:


Code:
=IF(COUNTIF(D69:D73,"yes")>=2,"Yes","No")
 
Upvote 0
Isn't this redundant? You are stating the same condition twice in the AND statement. :eeek:

Are you looking for when "Yes" appears twice in that range you defined?
 
Upvote 0
Thank you!
There is still one problem though
The way the code is written, if I make D69="yes" and the other cells "no" it will still make D67="yes". I want it so that it doesn't like allow repetition of a cell so there has to be two different cells that say "yes".
I don't know if you understand what i said :/

Thanks Comfy
SOLVED
 
Last edited:
Upvote 0
Maybe i'm missing something, but the two conditions seems to be identical, so why do you need the AND?

M.
 
Upvote 0
Thank you!
There is still one problem though
The way the code is written, if I make D69="yes" and the other cells "no" it will still make D67="yes". I want it so that it doesn't like allow repetition of a cell so there has to be two different cells that say "yes".
I don't know if you understand what i said :/

What Comfy posted should work for you.
 
Upvote 0
Ok I have another question
So for example when cell D69="yes", D67="yes"
BUT if D69="yes" and D70="yes", D67 would still ="yes"
So what I'm saying is the rules still stack
How do I make it so that ONLY if one cell="yes", then D67 would ="yes"

Thanks again
 
Upvote 0
Try:

=IF(COUNTIF(D69:D73,"yes")=1,"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,922
Latest member
nstaab07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top