Netted If Statement

时间:2018-04-13 18:28:05

标签: excel

我需要一个公式来告诉我特定单元格中的值是否在一定范围内。即使数字低于75K,下面的公式也会产生“> $ 75”的输出。任何人都可以帮我解决这个问题吗?非常感谢!

=IF(N2>100000,">$100K",IF(99999.99>N2>75000,">75K",IF(74999.99>N2>50000,">$50K",IF(49999.99>N2>30000,">$30K",IF(29999.99>N2>20000,">$20K",IF(19999.99>N2>10000,">$10K","<$10K"))))))

1 个答案:

答案 0 :(得分:1)

Excel不允许使用99999.99>N2>75000 AND(99999.99>N2, N2>75000)

但您可以将其简化为:

=INDEX({"<$10K",">$10k",">$20K",">$30K",">$50k",">$75k",">$100k"},MATCH(N2,{0,10000,20000,30000,50000,75000,100000}))

如果您真的想要IF,那么请认识到IF按顺序解析并且不需要上面谈到的AND。

=IF(N2>100000,">$100K",IF(N2>75000,">75K",IF(N2>50000,">$50K",IF(N2>30000,">$30K",IF(N2>20000,">$20K",IF(N2>10000,">$10K","<$10K"))))))

如果您有Office 365,则可以使用IFS():

=IFS(N2>100000,">$100K",N2>75000,">75K",N2>50000,">$50K",N2>30000,">$30K",N2>20000,">$20K",N2>10000,">$10K",N2<=10000,"<$10K")