Multiple IF statements between number ranges

Kristin picture Kristin · Aug 31, 2014 · Viewed 106.7k times · Source

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

Formula parse error

Here is the forumula:

=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")))

Answer

eniacAvenger picture eniacAvenger · Sep 22, 2014

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"))))