不太确定我是否可以使用if函数执行此操作?目前我正在使用以下公式:
=+IF(B7<100000,"CC",IF(B7<250000,"MV, MP, PM",IF(B7<500000,"FN",IF(B7<1000000,"KH",IF(B7>1000000,"DF",FALSE)))))
我想添加另一个标准cell A=1
然后C=+IF(B7<100000,"CC",IF(B7<250000,"MV, MP, PM",IF(B7<500000,"FN",IF(B7<1000000,"KH",IF(B7>1000000,"DF",FALSE)))))
如果A=2
则C=+IF(B7<10000,"CC",IF(B7<50000,"CCL",IF(B7<500000,"FN",IF(B7<1000000,"KH",IF(B7>1000000,"DF",FALSE)))))
希望我足够清楚并感谢你的帮助
更新:刚刚发现,它比想象的更容易:)
=+If(A=1,IF(B7<100000,"CC",IF(B7<250000,"MV, MP, PM",IF(B7<500000,"FN",IF(B7<1000000,"KH",IF(B7>1000000,"DF",FALSE))))),IF(B7<10000,"CC",IF(B7<50000,"CCL",IF(B7<500000,"FN",IF(B7<1000000,"KH",IF(B7>1000000,"DF",FALSE)))))
好的,只有在A为真或假的情况下它才有效,但这是我的情况
ps:我将尝试切换功能:)
答案 0 :(得分:1)
如果你可以使用嵌套来做到这一点。语法如下
=IF(A1=1;<first if>;IF(A1=2;<second if>;"Not in A 1 or 2"))
所以公式是。
=IF(A1=1;IF(B7<100000;"CC";IF(B7<250000;"MV, MP, PM";IF(B7<500000;"FN";IF(B7<1000000;"KH";IF(B7>1000000;"DF";FALSE)))));IF(A1=2;IF(B7<10000;"CC";IF(B7<50000;"CCL";IF(B7<500000;"FN";IF(B7<1000000;"KH";IF(B7>1000000;"DF";FALSE)))));"Not in A 1 or 2"))