How to split a list of numbers into 0-10, 11-20, 21-30 etc.

thisisbaris

New Member
Joined
Sep 15, 2017
Messages
6
Hi folks,
 
I have a long list (14,000 rows) of numbers (positive and negative) that I am trying to categorise into absolute value categories of 0 to 10, 11 to 20, 21 to 30 and so on ... So for example, 13 would return "11 to 20" and -4 would return "0 to 10".
 
These are my formula:
=IF(OR(AND(D3>-1,D3<11),(AND(D3<0,D3>-11))),"0 to 10","")
=IF(OR(AND(D3>10,D3<21),(AND(D3<-10,D3>-21))),"11 to 20","")
=IF(OR(AND(D3>20,D3<31),(AND(D3<-20,D3>-31))),"21 to 30","")
 
I have 10 columns of formula like this from "0 to 10" to "91-100". Only one of these 10 columns will be correct, so I have a =CONCATENATE column as the 11th column that returns the one true category.
 
It seems to be working perfectly for the majority of items. However, for those values that are between 30 and 31 such as -30.07 and -30.85, they are being categorised as both "21 to 30" and "31 to 40" - which I don't understand.
 
Are my formulas wrong? What is a better way of doing this?
 
Many thanks in advance!

 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try this instead:
Code:
=IF(AND(ABS(D3)>=0,ABS(D3)<=10),"0 to 10","")
etc.
 
Upvote 0
How about
=LOOKUP(ABS(D3),{0,11,21,31,41},{"0 to 10","11 to 20","21 to 30","31 to 40","41 to 50"})
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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