If statement 在Google工作表中使用嵌套IF

If statement 在Google工作表中使用嵌套IF,if-statement,google-sheets,nested,google-sheets-formula,array-formulas,If Statement,Google Sheets,Nested,Google Sheets Formula,Array Formulas,我试图在单个单元格中创建多个IF,因此如果单元格状态为“临界”,则相邻单元格应状态为“24小时内需要响应”。如果电池状态为“中”,相邻电池应状态为“48小时内需要响应”。如果它表示“低”,那么相邻的应该表示“在其他优先级被处理之后需要响应”。。。如何创建该公式?如下所示: =IF(A1="Critical"; "response required within 24hrs"; IF(A1="Medium"; "response required within 48hrs"; IF(A1=

我试图在单个单元格中创建多个IF,因此如果单元格状态为“临界”,则相邻单元格应状态为“24小时内需要响应”。如果电池状态为“中”,相邻电池应状态为“48小时内需要响应”。如果它表示“低”,那么相邻的应该表示“在其他优先级被处理之后需要响应”。。。如何创建该公式?

如下所示:

=IF(A1="Critical"; "response required within 24hrs";
 IF(A1="Medium";   "response required within 48hrs";
 IF(A1="Low";      "response required after other priorites are addresse"; )))
=ARRAYFORMULA(
 IF(A1:A10="Critical"; "response required within 24hrs";
 IF(A1:A10="Medium";   "response required within 48hrs";
 IF(A1:A10="Low";      "response required after other priorites are addresse"; ))))

对于这样的数组:

=IF(A1="Critical"; "response required within 24hrs";
 IF(A1="Medium";   "response required within 48hrs";
 IF(A1="Low";      "response required after other priorites are addresse"; )))
=ARRAYFORMULA(
 IF(A1:A10="Critical"; "response required within 24hrs";
 IF(A1:A10="Medium";   "response required within 48hrs";
 IF(A1:A10="Low";      "response required after other priorites are addresse"; ))))

如果使用
SWITCH
语句而不是使用多链
if
s,则会更容易

通用公式如下所示:
SWITCH(表达式,case1,value1,[case2\u或默认值,…],[value2,…])

因此,对于您的特殊用例,它将如下所示:

=SWITCH([CELL-TO-COMPARE],"Critical","response required within 24hrs","Medium","response required within 48hrs","Low","Response required after other priorites are addresse")
祝你玩得开心,干杯