Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
keen learner
 
Posts: n/a
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dav
 
Posts: n/a
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
keen learner
 
Posts: n/a
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
keen learner
 
Posts: n/a
Default 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


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
UDFunctions and nested If-the-else statements JDB Excel Worksheet Functions 1 January 25th 06 03:29 PM
combining conditional statements wrosie Excel Worksheet Functions 4 November 29th 05 09:59 AM
Linking two IF statements together trixma Excel Discussion (Misc queries) 2 September 29th 05 06:07 AM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM
Combining IF and multiple SUMIF statements, if A>0 & B is between Lee Excel Worksheet Functions 1 January 3rd 05 06:46 PM


All times are GMT +1. The time now is 09:26 AM.

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"