Excel formula 如果,和或声明

Excel formula 如果,和或声明,excel-formula,Excel Formula,我有一个关于IF、AND和OR语句的Excel查询。我有一个电子表格,在市中心的商店不应该营业的时候却营业 我已经展示了电子表格的一个片段,用简单的英语我需要做以下工作: IF E2 is "Open" AND F2 is "YES" then status should read "Normal" IF E2 is "Open" AND F2 is "NO" then status should read "Warning, this store should be open" IF E2

我有一个关于IF、AND和OR语句的Excel查询。我有一个电子表格,在市中心的商店不应该营业的时候却营业

我已经展示了电子表格的一个片段,用简单的英语我需要做以下工作:

IF E2 is "Open" AND F2 is "YES" then status should read "Normal"

IF E2 is "Open" AND F2 is "NO" then status should read "Warning, this store should be open"

IF E2 is "Closed" AND F2 is "YES" then status should read "Warning, this store should not be open"
我已经尝试过了,并提出了2个独立工作的语句(如下所示)。我一直在读嵌套语句,看起来这就是我在这里需要做的,但是我就是不知道我是如何将所有的嵌套语句缝合到一个语句中的

=IF(AND(E2="Open",H2="NO"),"Warning, this store should be open","Normal")

=IF(AND(E2="Closed",H2="YES"),"Warning, this store should not be open","Normal")

您已经提到在公式中使用
,但我认为使用嵌套的
如果
s,这很容易实现:

=IF(E2="Open",IF(F2="YES","Normal","Warning, this store should be open"),IF(F2="YES","Warning, this store should not be open",""))
如何想象上述陈述的作用:

E2               F2               Output
Open             YES              Normal
Open             (anything else)  Warning, this store should be open
(anything else)  YES              Warning, this store should not be open
(anything else)  (anything else)  (empty string)
您可能希望其他行为依赖于
E2
F2
的其他值,但鉴于您的要求,上述操作将起作用