Excel多个if语句,回复超过2个

时间:2017-10-11 20:33:48

标签: excel

试图获得一个excel电子表格来做我需要的东西,我基本上是计算机文盲。任何帮助,将不胜感激 基本上我需要的是下面的语句合并

If E8 = Officer and G8 = Active Duty then 1
If E8 = Officer and G8 = Active Reserve then 2
if E8 = Enlisted and G8 = Active Duty then 3
If E8 = Enlisted and G8 = Active Reserve then 4

我已经能够找出一些基本的和if语句,但是这个有多个结果的那个让我循环,所有这些都需要进入一个单元格,如果可能的话。谢谢你们

3 个答案:

答案 0 :(得分:4)

=MATCH(E8&G8,{"OfficerActive Duty","OfficerActive Reserve","EnlistedActive Duty","EnlistedActive Reserve"},0)

OR

=(MATCH(E8,{"Officer","Enlisted"},0)-1)*2+MATCH(G8,{"Active Duty","Active Reserve"},0)

答案 1 :(得分:0)

这就是你需要的:

IF(AND(E8="Officer",G8="Active Duty"), 1, 
      IF(AND(E8="Officer",G8="Active Reserve"), 2, 
               IF(AND(E8="Enlisted",G8="Active Duty"), 3, 4)))

答案 2 :(得分:0)

如果将来需要大量使用,最好设置为查找表,以及如何使用数组公式(单击 Ctrl + < kbd> Shift + 一起输入

=INDEX($C$2:$C$5,MATCH(E2&F2,$A$2:$A$5&$B$2:$B$5,0),1)

这样,您可以随时动态更新条件。

另外,您可以根据您的条件(Data > Data Tools > Data Validation)设置下拉列表:

相关问题