Excel formula to sort into Bins

lpellica

New Member
Joined
Mar 15, 2012
Messages
20
What's the easiest formula to check to see which bin the value of a field fits into? For instance, if I want to add a column that classifies one column whose values could be potentially be one of 100 or so numerical values into 8 numerical categories. The categories would be 0 to 1, 2 to 10, 11 to 25, 26 to 40, 41 to 55, 56 to 70, 71 to 85, 86 to 110, and the appropriate category would populate another column.

Is it some combination of a formula and a lookup table, or should you do it with a formula alone?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Have a look at the FREQUENCY function.
 
Upvote 0
I know how to use the FREQUENCY function to come up with a separate small table to identify how many total records fall into each category.

What I'd like to do is add a field for each record in the big data table identifying which category that record falls into, based on another field in each record. Something like... IF(AND(A2<=40,A2>25),40,?)
 
Upvote 0
Ah.

=LOOKUP(A1, {-9E+307,0,2,11,26,41,56,71,86,111}, {"other","0 to 1","2 to 10","11 to 25","26 to 40","41 to 55","56 to 70","71 to 85","86 to 110","other"})
 
Upvote 0
BIIIG negative number, to snag the values less than 0.

You're welcome, good luck.
 
Upvote 0

Forum statistics

Threads
1,215,129
Messages
6,123,218
Members
449,091
Latest member
jeremy_bp001

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