本文介绍了数字范围之间的多个IF语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立一个在数字范围之间具有多个IF语句的公式,但是我看到了错误:

I'm trying to set up a formula with multiple IF statements between number ranges but I'm seeing the error:

这里是论坛:

=IF((AND(A2>0,A2<500),"Less than 500",
 If(AND(A2>=500,A2<1000),"Between 500 and 1000"),
 If(AND(A2>=1000,A2<1500),"Between 1000 and 1500"),
 If(AND(A2>=1500,A2<2000),"Between 1500 and 2000")))

推荐答案

由于嵌套的IF,这有点棘手,但这是我的答案(已在Google Spreadsheets中确认):

It's a little tricky because of the nested IFs but here is my answer (confirmed in Google Spreadsheets):

=IF(AND(A2>=0,    A2<500),  "Less than 500", 
 IF(AND(A2>=500,  A2<1000), "Between 500 and 1000", 
 IF(AND(A2>=1000, A2<1500), "Between 1000 and 1500", 
 IF(AND(A2>=1500, A2<2000), "Between 1500 and 2000", "Undefined"))))

这篇关于数字范围之间的多个IF语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 22:22