简体   繁体   English

如何在Excel公式中包含多个IF?

[英]How to include Multiple IFs in Excel formula?

I have the formula below that has two IF Statements however it is given an error. 我在下面的公式中有两个IF语句,但是给出了错误。 Any help is appreciated. 任何帮助表示赞赏。

=IF((AND(B11>65,D15>65)),Sheet!D$47,VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE)),IF((AND(B11>61,D15>61)),Sheet!D$44,VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE))

What I am trying to Achieve is the following: 我正在尝试实现以下目标:

IF B11>65 and D15 >65 Then select value from D$47. 如果B11> 65并且D15> 65,则从D $ 47中选择值。 IF B11<65 and D15<65 Then Select value from D$44. 如果B11 <65和D15 <65,则从D $ 44中选择值。 Else VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE)) 其他VLOOKUP(D15,Sheet!$ A $ 2:$ K $ 51,4,FALSE))

You can have multiple IF() calls embedded such as this: 您可以嵌入多个IF()调用,例如:

=IF(AND(), Sheet!D$47, IF(AND(), Sheet!D$44, VLOOKUP())

The complete form in your case would be: 您所填写的完整表格为:

=IF(AND(B11>65,D15>65), Sheet!D$47, IF(AND(B11>61,D15>61), Sheet!D$44, VLOOKUP(D15,Sheet!$A$2:$K$51,4,FALSE)))

Basically, this uses the 'Else' clause as a means to add additional clauses. 基本上,这使用'Else'子句作为添加其他子句的方式。 It is possible to do it the other way around but I personally find that harder to read. 可以用另一种方法来做,但是我个人觉得很难阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM