0

我有一个带有以下代码的计算列。“状态”列的状态均为“未开始”、“进行中”、“已提交”和“已发送调查”。

我正在尝试使如果状态不是“已提交”或“已发送调查”,则将其设置为“未完成”,否则它们都处于“已发送调查”或“已提交”状态,它将返回作为“完成”。

我的问题是我无法让语法正确以使其以这种方式工作;我试过 OR() 但我可能做得不对?任何帮助,将不胜感激。

当前计算列

=IF(NOT([Day 1 Status]="Survey Sent"),"Not Completed",
IF(NOT([Week 1 Status]="Survey Sent"),"Not Completed",
IF(NOT([30 Day Status]="Survey Sent"),"Not Completed",
IF(NOT([90 Day Status]="Survey Sent"),"Not Completed",
IF(NOT([6 Month Status]="Survey Sent"),"Not Completed",
IF(NOT([Year 1 Status]="Survey Sent"),"Not Completed","Completed"))))))

我在逻辑上寻找什么

If Day 1 Status is not "Survey Sent" or not "Submitted", then "Not Completed"
If Week 1 Status is not "Survey Sent" or not "Submitted", then "Not Completed"
If 30 Day Status is not "Survey Sent" or not "Submitted", then "Not Completed"
If 90 Day Status is not "Survey Sent" or not "Submitted", then "Not Completed"
If 6 Month Status is not "Survey Sent" or not "Submitted", then "Not Completed"
If Year 1 Status is not "Survey Sent" or not "Submitted", then "Not Completed"
Else then "Completed"
4

1 回答 1

0

这可能晚了。但我想我得到了你想要的。我认为你解释的并不是你真正需要的。

如果状态不是“已提交”或“已发送调查”,则设置为“未完成”

此条件始终为!因为状态不能同时是“已提交”“已发送调查”。因此,任何一个表达式都为真,并且由于OR,整个表达式都为真。相反,我猜你的意思是:

如果状态不是“已提交”且不是“已发送调查”,则将其设置为“未完成”。

您问题中的另一个含糊之处是您在不同状态条件之间需要的逻辑运算符。问自己这个问题:“您是否需要所有状态字段既不是调查已发送也不是已提交以将值设置为未完成?或者只是其中一个不是调查已发送或提交就足以使计算的字段未完成? " 如果其中一个就足够了,则需要在状态条件之间使用OR运算符,否则将需要AND

同样,从逻辑上看,我猜您需要发送或提交其中任何一个,以使整体状态为“未完成”,在这种情况下,您将需要在状态条件之间进行OR 。要在如此复杂的计算列中构建查询,最好的方法是使用 Microsoft Excel,因为计算列的公式与 Microsoft Excel 的公式非常相似。我使用了 Excel,最后的查询是:

=IF(
OR(
AND([Day 1 Status]<>"Survey Sent",[Day 1 Status]<>"Submitted"),
AND([Week 1 Status]<>"Survey Sent",[Week 1 Status]<>"Submitted"),
AND([30 Day Status]<>"Survey Sent",[30 Day Status]<>"Submitted"),
AND([90 Day Status]<>"Survey Sent",[90 Day Status]<>"Submitted"),
AND([6 Month Status]<>"Survey Sent",[6 Month Status]<>"Submitted"),
AND([Year 1 Status]<>"Survey Sent",[Year 1 Status]<>"Submitted")
),
"Not Completed","Completed")
于 2013-07-19T21:26:50.083 回答