Combining "AND" with "OR" Statements

K

keen learner

How do i join two AND statements with and OR

Cell a1 can be yes or no
cell b1 can be 1 or 0

If bi = 1 and a1 = "yes" then c1 should should contain "A"
If bi = 1 and a1 = "no" then c1 should contain "R"
IF B1 = 0 THEN C1 SHOULD BE BLANK
pLEASE HELP
 
D

Dav

AND and OR statements are usually used as part of a condition or to
return a true of false. You are better using if statements

they take the basic for If(true,this,otherwise that)

To cope with more than 2 outcomes they can be nested

=IF(B1=1,IF(A1="yes","A","R"),"")

If B1=1 and A1=yes then A
If B1=1 and A1 is not yes (the only other option is no) return R
If B1 does not equal 1 return blank
 
H

hansyt

A B C D
1 yes 1 A =IF(B1=0;"";IF(A1="yes";"A";IF(A1="no";"R";"??")))
2 no 1 R =IF(B2=0;"";IF(A2="yes";"A";IF(A2="no";"R";"??")))
3 0 =IF(B3=0;"";IF(A3="yes";"A";IF(A3="no";"R";"??")))
4 Bla 1 ?? =IF(B4=0;"";IF(A4="yes";"A";IF(A4="no";"R";"??")))

if B can contain values other than 0 or 1 than use this form:

5 2 ##
=IF(B5=0;"";IF(B5<>1;"##";IF(A5="yes";"A";IF(A5="no";"R";"??"))))

Is that what you meant?

Hans
 
Top