带有文本和值的嵌套IF和语句

时间:2015-05-14 19:41:07

标签: excel-formula

我正在尝试创建一个嵌套的if语句,表示如果列k = F且0则返回Female Non Enrolled,如果K = F且> 0返回Female Enrolled,如果K = M且0返回Male Non Enrolled,如果K = M且> 0返回登记。我试过这个:= IF(AND(K2 = F,AN2 = 0,“女性非登记”,IF(AND(K2 = F,AN2> 0,“女性登记”,IF(AND(K2 = M,AN2) = 0,“男性未注册”,“男性注册”))))))但是有一个错误,或者我做错了。谢谢你的帮助!

1 个答案:

答案 0 :(得分:1)

你没有关闭你的AND语句,只是在公式末尾堆积了parens。此外,你的字符串应该在""试试这个:

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