Combining "AND" with "OR" Statements
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 |
Combining "AND" with "OR" Statements
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 -- Dav ------------------------------------------------------------------------ Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107 View this thread: http://www.excelforum.com/showthread...hreadid=507126 |
Combining "AND" with "OR" Statements
THANKS A MILLION DAV, IT WORKS SPLENDIDLY
"Dav" wrote: 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 -- Dav ------------------------------------------------------------------------ Dav's Profile: http://www.excelforum.com/member.php...o&userid=27107 View this thread: http://www.excelforum.com/showthread...hreadid=507126 |
Combining "AND" with "OR" Statements
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="n o";"R";"??")))) Is that what you meant? Hans |
Combining "AND" with "OR" Statements
Thank you very much Hans
" wrote: 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="n o";"R";"??")))) Is that what you meant? Hans |
All times are GMT +1. The time now is 09:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com