我正在制作excel表格,但excel不允许我进一步检查并发出错误to many argument for this formula
。
请给我解决方案。
=IF(E2="NL",N2-(J2*0.08),IF(AND(E2="PA",H2="Trip Travel"),(N2*0.01)+N2,(N2*0.02)+N2,IF(AND(E2="PK",H2="Trip Travel"),(J2*0.01)+N2,(J2*0.02)+N2)))
编辑以澄清可能的情况:
1. E is "NL" and H is "Other" : return N2+(J2*0.08)
2. E is "NL" and H is "Trip Travel" : return N2+(J2*0.08)
3. E is "PK" and H is "Other" : return N2+(J2*0.01)
4. E is "PK" and H is "Trip Travel" : return N2+(J2*0.01)
5. E is "PA" and H is "Other" : return N2+(N2*0.02)
6. E is "PA" and H is "Trip Travel" : return N2+(N2*0.01)
答案 0 :(得分:2)
问题是第二个IF
函数,它有4个参数。 IF
只需3:
有问题的部分是:
IF(AND(E2 =“PA”,H2 =“跳闸行程”),(N2 * 0.01)+ N2,(N2 * 0.02)+ N2,IF(AND(E2 =“PK”,H2 =“跳闸行程“),(J2 * 0.01)+ N2,(J2 * 0.02)+ N2))
注意该部分中IF
函数有4个参数:
AND(E2="PA",H2="Trip Travel")
(N2*0.01)+N2
(N2*0.02)+N2
IF(AND(E2="PK",H2="Trip Travel"),(J2*0.01)+N2,(J2*0.02)+N2)
我不确定如何纠正这个问题,因为我无法从该公式中确定您想要的逻辑。但是,我猜测(N2*0.01)+N2
或(N2*0.02)+N2
属于不同的部分。
另外,为了帮助简化公式,可以在第二个IF
之前放置“+ N2”并删除所有“+ N2”,因为所有结果都添加了N2。类似下面的内容(由于我不确定你想要如何修正逻辑,它仍然有4个参数):
= IF(E2 =“NL”,N2-(J2 * 0.08), N2 + IF(AND(E2 =“PA”,H2 =“Trip Travel”),(N2 * 0.01),(N2 * 0.02),IF(AND(E2 =“PK”,H2 =“跳闸行程”),(J2 * 0.01),(J2 * 0.02))))
编辑已修改的问题:
此公式应涵盖电子表格中的六种可能性:
= IFERROR(N2 + IF(E2 =“NL”,J2 * 0.08,IF(E2 =“PK”,J2 * 0.01,IF(E2 =“PA”,IF(H2 =“Trip Travel”,N2) * 0.01,IF(H2 = “其他”,N2 * 0.02, “N / A”)), “N / A”)))中, “n / a”)的