Nested IF based on two cells which contain yes, no or blank

xl22

New member
Joined
Mar 23, 2016
Messages
6
Reaction score
0
Points
0
I am trying to develop a nested IF formula to give me a 1 or a 0 depending on the text in two other cells. My data looks something like this:
A1B1C1
yesno1
yesyes0
noyes1
nono1
0

C1 shows the output I wanted - a 1 if any cell has a "no" and a 0 if the cell is "yes" or blank. I keep running into problems with getting a 2, only getting 0, or only getting 1, and think it must be something to do with the order in which I am nesting my IF statements.


Any help appreciated!!
 
Try:

=IF(OR(A1="no",B1="no"),1,0)

or if there are many columns, something more like:

=IF(COUNTIF(A1:B1,"no")>0,1,0)

You can also eliminate the IF's since you are using a boolean result (true/false,1/0)

=OR(A1="no",B1="no")+0

or

=COUNTIF(A1:B1,"no")>0+0

The +0 coerces the TRUE/FALSE results to 1/0, respectively.

 
Thanks all, those worked great! I had tried the OR function, but wasn't using it properly.
 
Back
Top