Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 If Then Formula Help 4

Status
Not open for further replies.

briangriffin

Programmer
Nov 6, 2008
878
US
A1: Y B1: 1 C1: ???
A2: Y
A3: N


Need formula in C1 to return 'Y' if:

B1 = 1 AND A1 = 'Y' and A2 = 'Y' and A3 = 'Y'
OR IF
B1 = 2 and A1 = 'Y' and A2 = 'Y'

Seems like I can get either the test for A cell values or the test for B1 value working, but not all in one formula.

Thanks in advance.
 
=IF(A1="y",IF(A2="y",IF(A3="y",IF(B1=1,"Y",""),""),""),"")&IF(A1="y",IF(A2="y",IF(B1=2,"Y",""),""),"")


Never miss an opportunity to shut up
 
Hi,


B1 = 1 AND A1 = 'Y' and A2 = 'Y' and A3 = 'Y'
OR IF
B1 = 2 and A1 = 'Y' and A2 = 'Y'

=if(or(and(b1=1,a1="Y",a2="Y",a3="Y"),and(b1=2,a1="Y",a2="Y")),"Y","")
 
Seems easy when I see you guys do it... thanks to you both.
 
Because A1 = 'Y' and A2 = 'Y' on both branches, both formulas can be shortened.

=IF(A1="y";IF(A2="y";IF(B1=2;"Y";IF(B1=1;IF(A3="y";"Y";"")));"");"")

=IF(AND(A1="Y";A2="Y";OR(AND(B1=1;A3="Y");B1=2));"Y";"")


Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top