Whitney
Whitney

Reputation: 3

Nested IF And Statement with text and value

I am trying to create a nested if statement that says if column k = F and 0 then return Female Non Enrolled, if K= F and >0 return Female Enrolled, if K = M and 0 return Male Non Enrolled, if K = M and >0 return Enrolled. I tried this: =IF(AND(K2=F,AN2=0,"Female Non-Enrolled",IF(AND(K2=F,AN2>0,"Female Enrolled",IF(AND(K2=M,AN2=0,"Male Non-Enrolled","Male Enrolled")))))) but there is an error, or perhaps I am doing is wrong. Thanks for your help!

Upvotes: 0

Views: 277

Answers (1)

nwhaught
nwhaught

Reputation: 1592

You didn't close your AND statements, just piled up the parens at the end of the formula. Also, your strings should be in "" Try this:

=IF(AND(K2="F",AN2=0),"Female Non-Enrolled",IF(AND(K2="F",AN2>0),"Female Enrolled",IF(AND(K2="M",AN2=0),"Male Non-Enrolled","Male Enrolled")))

Upvotes: 1

Related Questions