我正在尝试编写公式并收到错误。逻辑是:
If A1 > 0 and B1 = "PEN" Output = "Refund 1"
If A1 > 0 and B1 = "INT" Output = "Refund 1"
If A1 > 0 and B1 = "ADM" Output = "Refund 1"
If A1 > 0 and B1 = "AB" Output = "Refund 2"
If A1 < 0 and B1 = "PEN" Output = "Fund 1"
If A1 < 0 and B1 = "INT" Output = "Fund 1"
If A1 < 0 and B1 = "ADM" Output = "Fund 1"
If A1 < 0 and B1 = "AB" Output = "Fund 2"
我在编写多个If语句时遇到错误。
有人可以帮忙吗?
答案 0 :(得分:0)
这对你有用。
=IF(AND(A1>0,OR(B1="PEN",B1="INT",B1="ADM")),"Refund 1",IF(AND(A1>0,B1="AB"),"Refund 2",IF(AND(A1<0,OR(B1="PEN",B1="INT",B1="ADM")),"Fund 1",IF(AND(A1<0,B1="AB"),"Fund 2"))))
答案 1 :(得分:0)
虽然@ Jeanno的答案适用于这种情况,但我想指出你可以使用查找表更一般地完成同样的事情。
蓝色的项目是硬编码的,黑色是公式。
这样做有几个好处: