Combined multiple IFs and AND functions

G

Ginger

Hi,

I have a problem coming up with an IF statement for the below scenario.

Scenario

A = Y
B = N
where Y is Yes and N is No. The Y and N is entered by the user.

If A= Y and B= Y, execute A1
If A= Y and B= N, execute B1
If A= N and B= Y, execute C1
If A= N and B= N, execute D1

I used an "IF(AND(...,...)", however, I got #Value! for the answer. Can someone please help?

Thanks in advance
 
F

Frank Kabel

Hi
one way (if you enter value A in cell E1 and value B in
cell F1)
=IF(E1="Y",IF(F1="Y",A1,IF(F1="N",B1,"not defined")),IF
(E1="N",IF(F1="Y",C1,IF(F1="N",D1,"not defined")),"not
defined"))
-----Original Message-----
Hi,

I have a problem coming up with an IF statement for the below scenario.

Scenario

A = Y
B = N
where Y is Yes and N is No. The Y and N is entered by the user.

If A= Y and B= Y, execute A1
If A= Y and B= N, execute B1
If A= N and B= Y, execute C1
If A= N and B= N, execute D1

I used an "IF(AND(...,...)", however, I got #Value! for
the answer. Can someone please help?
 
D

Dana DeLouis

This technique doesn't have any error checking

=CHOOSE(SEARCH(E1&F1,"YYNNY"),A1,B1,D1,C1)
 
J

Jack Sons

Dana,

It is genial. Would never have come up with that.

Jack Sons
The Netherlands
 
G

Ginger

Thank you. It works.
Appreciate your help.
-----Original Message-----
This technique doesn't have any error checking

=CHOOSE(SEARCH(E1&F1,"YYNNY"),A1,B1,D1,C1)

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =



[email protected]... for the answer. Can
someone please help?


.
 
G

Ginger

Thank you. This works too. :)
Appreciate it.
-----Original Message-----
Hi
one way (if you enter value A in cell E1 and value B in
cell F1)
=IF(E1="Y",IF(F1="Y",A1,IF(F1="N",B1,"not defined")),IF
(E1="N",IF(F1="Y",C1,IF(F1="N",D1,"not defined")),"not
defined"))
the
the answer. Can someone please help?
.
 
Top