0

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!

1
  • Welcome to Stack Overflow! You should check out how to ask a question. It contains helpful advice on how to word your question to get the best possible response. Commented May 14, 2015 at 19:45

1 Answer 1

1

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")))

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, worked like a charm! Signed: A beginner ;)
As a side note, you can investigate what your formulas are doing by selecting "Evaluate Formulas" under the "Formulas" tab. It will show you step by step what is happening when excel tries to evaluate your formulas, including which steps are generating errors. Glad I could help. :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.