Excel嵌套IF查询


0

我有一个嵌套的IF函数,我已经创建并且我正在尝试使用它。

=IF(AND(K2>=Summary!$D$1,I2>Summary!$A$8,J2>0),"Poor 
Performer",IF(AND(J2=0,F2>30),"Pause",IF(AND(J2=0,F2<30,I2>10),"High 
Spender",IF(OR(E2<Summary!$A$13,E2="-"),"Low Traffic 
Boost",IF(K2<Summary!$C$1,"Under Invested","No Change")))))

我正在尝试调整低流量增强部分以获得附加条件,以便输出准确。这就是它:

IF(OR(E2<Summary!$A$13,E2="-"),"Low Traffic Boost"

而我正试图将其改为此。

IF(OR(AND (K2<=Summary!$D$1,E2<Summary!$A$13),
AND(E2="-,K2<=Summary!$D$1),"Low Traffic Boost"

但是,我一直收到错误。你能帮帮我吗?我不确定为什么我的带有AND,OR语句的嵌套IF无法正常工作。


您的更正版本缺少右括号。这是整个变化吗?
Seth 2017年

嗨Seth,是的,正如工程师Toast在下面回答的那样,我在第二个函数之后错过了一个结束括号,这是我声明中的错误。
anish rao

Answers:


1

将公式复制到文本编辑器并尝试添加换行符以查看错误。

=IF(
    AND(K2>=Summary!$D$1,I2>Summary!$A$8,J2>0),
    "Poor Performer",
    IF(
       AND(J2=0,F2>30),
       "Pause",
       IF(
          AND(J2=0,F2<30,I2>10),
          "High Spender",
          IF(
             OR(E2<Summary!$A$13,E2="-"),
             "Low Traffic Boost",
             IF(
                K2<Summary!$C$1,
                "Under Invested",
                "No Change"
               )
            )
         )
      )
    )

每个IF陈述都有三个参数。大多数时候,这是另一个IF声明,但没关系。每个人都使用括号( )来捕获它的三个参数。现在为你的公式做同样的事情。

IF(
   OR(
      AND(K2<=Summary!$D$1,E2<Summary!$A$13),
      AND(E2="-,K2<=Summary!$D$1),
      "Low Traffic Boost"

看起来你想要替换IF可以返回的语句,Low Traffic Boost所以这不是一个完整的公式,只是一个片段。问题是您没有使用任何括号来关闭OR语句。它应该如下所示:

IF(
   OR(
      AND(K2<=Summary!$D$1,E2<Summary!$A$13),
      AND(E2="-,K2<=Summary!$D$1)
     ),
  "Low Traffic Boost"

我在第二个AND和逗号之间添加了一个结束的parantheses ,。那么,整个公式应如下所示:

=IF(
    AND(K2>=Summary!$D$1,I2>Summary!$A$8,J2>0),
    "Poor Performer",
    IF(
       AND(J2=0,F2>30),
       "Pause",
       IF(
          AND(J2=0,F2<30,I2>10),
         "High Spender",
         IF(
            OR(
               AND(K2<=Summary!$D$1,E2<Summary!$A$13),
               AND(E2="-,K2<=Summary!$D$1)
              ),
            "Low Traffic Boost",
            IF(
               K2<Summary!$C$1,
               "Under Invested",
               "No Change"
              )
           )
         )
      )
    )

折叠成一行,就是这样:

=IF(AND(K2>=Summary!$D$1,I2>Summary!$A$8,J2>0),"Poor Performer",IF(AND(J2=0,F2>30),"Pause",IF(AND(J2=0,F2<30,I2>10),"High Spender",IF(OR(AND(K2<=Summary!$D$1,E2<Summary!$A$13),AND(E2="-,K2<=Summary!$D$1)),"Low Traffic Boost",IF(K2<Summary!$C$1,"Under Invested","No Change")))))

谢谢!这确实有帮助。我会通过换行将它分开,这样我可以避免错过括号:)
anish rao

Excel还尝试通过对括号进行颜色编码来帮助解决这个问题。在这种情况下,所有这些都有太多的独特颜色。不过,它仍然有点帮助。
工程师敬酒2017年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.