if formula based on ranges

snash

Board Regular
Joined
Jan 12, 2006
Messages
222
Hi there, I want to input a formula that looks at column A and assigns a group. So if(A2>,"0-5",if(A2<=0,"6-10",if(A2<=5,"11-15",IF(A2<=0,"16-30",if(A2>50,">50"))))) How can I write this correctly?

Thanks!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You have some missing details and errors in that formula to the extent that I cannot really understand exactly what you want to happen.
Can post your conditions, in plain English, of what you want to happen?
 
Upvote 0
Thanks Joe, basically I want a formula to show that if a number lands within a particular range, then I want the output to show the actual range??
 
Upvote 0
But what are your ranges? Your formulas have a bunch of errors in them, so I really cannot tell:

In looking at all your formulas, you have:
if(A2>,"0-5" you are missing a number after your greater than sign
if(A2<=0,"6-10" I fail to see how number less than zero would fall between 6 and 10
if(A2<=5,"11-15" I fail to see how number less than 5 would fall between 11 and 15
IF(A2<=0,"16-30" why are you checking for less than zero again (you already did that earlier)
if(A2>50,">50" ​this is the only one which seems to make any sense to me
 
Upvote 0
Hi, I know have it wrong - sorry. That's why I need help. I have a list of numbers in column A.
In Column B, I want to return a range, based on the number in Column A. The ranges are: 0-5, 6-10, 11-15, 16-30, 31-50, >50. So if A5 had a 28, then B5 would return the range "16-30". Make sense?
 
Upvote 0
Yes, that makes sense. Based on your original formula, I couldn't tell if you had some sort of special sequence or something.
Try this:
Code:
=IF(A2>50,">50",IF(A2>=31,"31-50",IF(A2>=16,"16-30",IF(A2>=11,"11-15",IF(A2>=6,"6-10",IF(A2>0,"0-5","NOT FOUND"))))))
The secret is to either start from the highest and work to the lowest, or vice versa.
 
Upvote 0
No problem!

It is always a good idea if you have a formula (or VBA code) that is not working properly to explain how it should work (in addition to posting the formula).
Otherwise, if there is some flaw in the logic of your formula, the answer we come up for you may also contain that same flaw and be incorrect.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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