我想在多个条件下使用嵌套的 if(and) excel 函数来获得 3 个结果“有效”、“无效”或“”空白,我该如何最好地编写这些?

问题描述 投票:0回答:1
=IF(
    AND(
        [@[Key Populations]]<>"Preg";
        [@[Key Populations]]<>"BF";
        [@Age]>14;
        P135>='information Sheet'!$AD$2;
        P135<='information Sheet'!$AE$2
        );
    "VALID";
    "INVALID";
    IF(
    (OR(
        [@[Key Populations]];"Preg";
        [@[Key Populations]];"BF";
        [@Age]=<14;
        P135>='information Sheet'!$AD$2;
        P135<='information Sheet'!$AE$2
        );
    " ";
    "False")))

我收到错误消息,我期望有效、无效或空白

excel if-statement nested
1个回答
0
投票

你必须更仔细地思考你的逻辑。您可以编辑您的问题来解释您想要的输出是什么以及在什么条件下?

=IF(
AND([@[Key Populations]]<>"Preg";[@[Key Populations]]<>"BF";[@Age]>14;P135>='information Sheet'!$AD$2;P135<='information Sheet'!$AE$2) // Condition 1
;"VALID"; // Result for TRUE
"INVALID"; // This is wrong, should be condition for FALSE
IF((OR([@[Key Populations]];"Preg";[@[Key Populations]];"BF";[@Age]=<14;P135>='information Sheet'!$AD$2;P135<='information Sheet'!$AE$2); // Should be @[Key Populations]]="Preg" and [@[Key Populations]]="BF"
" ";
"False")))
© www.soinside.com 2019 - 2024. All rights reserved.