Traying to create income ranges using nested IF with AND

Nathag

New Member
Joined
Aug 1, 2013
Messages
17
I am trying to create the following income ranges in a document.

Less than $5000
$5,000 - $9,999
$10,000 - $19,999
$20,000 - $29,999
$30,000 - $39,999
$40,000 - $49,999
$50,000 - $59,999
$60,000 - $69,999
$70,000 and Over

The data set is too large for grouping ranges in a pivot table, so I thought I might add a helper column to the data range directly by adding a column next to the total income field. I then thought to myself, "Self, wouldn't it be great if I could just use a nested IF statement with AND for those ranges that require it and just copy down?"

No such luck. I tried the following formula and do not quite understand what I did wrong. Total income is in column AF and I am just randomly starting with row 702.

=IF(AF702<5000,"Less than $5,000", IF(AND(AF702>=5000,AF702<10000),"$5,000 - $9,999", IF(AND(AF702>=10000,AF702<20000),"$10,000 - $19,999", IF(AND(AF702>=20000,AF702<30000),"$20,000 - $29,999", IF(AND(AF702>=30000,AF702<40000),"$30,000 - $39,999", IF(AND(AF702>=40000,AF702<50000),"$40,000 - $49,999", IF(AND(AF702>=50000,<60000),"$50,000 - $59,999", IF(AND(AF702>=60000,<70000),"$60,000 - $69,999", IF(AF702>=70000,"$70,000 and Over","N/A")))))))))

Does Excel not allow IF statements without the AND to be mixed in with IF(AND statements? What am I doing wrong here?

Any help is appreciated!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Why don't you create an helper column and just use a simple VLOOKUP, like this:


Book1
ABCDE
1ValueText
20Less than $500059999
35000$5,000 - $9,999$50,000 - $59,999
410000$10,000 - $19,999
520000$20,000 - $29,999
630000$30,000 - $39,999
740000$40,000 - $49,999
850000$50,000 - $59,999
960000$60,000 - $69,999
1070000$70,000 and Over
Sheet1
Cell Formulas
RangeFormula
E3=VLOOKUP(E2,$A$2:$B$10,2)
 
Upvote 0
Of course, my approach may not be the only approach. Maybe my formula is wrong? Maybe it is impossible? Maybe it can be done with pivot tables and I am unaware of the technique for placing tens of thousands of unique values into ranges?

I'm eager to learn.
 
Upvote 0
Hi,


One way.


=LOOKUP(AF702,{0,5000,10000,20000,30000,40000,50000,60000,70000},{"Less than $5000","$5000-$9999","$10,000-$19,9999","$20,000-$29,999","$30,000-$39,999","$40,000-$49,999","$50,000-$59,999","$60,000-$69,999","$70,000 and over"})
 
Upvote 0
Caribeiro77 - that VLOOKUP trick worked. I forgot about the ability to match approximate without going over. Never even occurred to me to use VLOOKUP for the ranges. Learning something new in Excel everyday. Thank you!!!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top