If, And, Or Formula

C

Clara

I need help, basically if B8 is equal to the following and attributes and E5
is equal to the other attributes, and I5 is greater than 19, then yes.

I get an error when using the following formula, and I'm not sure if it's a
parenthesis missing or a comma out of place. Can someone help me with this.

=IF(AND(OR($B$8="FAPI",$B$8="PAPI",$B$8="EXPAT",$B$8="INPAT"),$E$5="A",$E$5="L",$E$5="P",$E$5="U",($I$5>19),"Y","N"))
 
T

Toppers

=IF(AND(OR($B$8="FAPI",$B$8="PAPI",$B$8="EXPAT",$B$8="INPAT"),$E$5="A",$E$5="L",$E$5="P",$E$5="U",$I$5>19),"Y","N")
 
B

bj

you also need another or
=IF(AND(OR($B$8="FAPI",$B$8="PAPI",$B$8="EXPAT",$B$8="INPAT"),or($E$5="A",$E$5="L",$E$5="P",$E$5="U"),$I$5>19),"Y","N"))
 
T

Toppers

....well spotted. I missed the other "OR".

bj said:
you also need another or
=IF(AND(OR($B$8="FAPI",$B$8="PAPI",$B$8="EXPAT",$B$8="INPAT"),or($E$5="A",$E$5="L",$E$5="P",$E$5="U"),$I$5>19),"Y","N"))
 
F

Farhad

Hi,

=IF(AND(OR($B$8="FAPI",$B$8="PAPI",$B$8="EXPAT",$B$8="INPAT"),OR($E$5="A",$E$5="L",$E$5="P",$E$5="U"),$I$5>19),"Y","N")

Thanks,
 
R

Ragdyer

You could shorten it slightly if you used array constants:

=IF(AND(OR($B$8={"FAPI","PAPI","EXPAT","INPAT"}),OR($E$5={"A","L","P","U"}),$I$5>19),"Y","N")
 
Top