Grouping items according to ranges

Hi all;
I have a list containing random numbers that i want to rearrange it according to specified ranges.
For example; the list is something like numbers from 1 to 100, but in random order and duplicated, i want to organize in groups like this: values that are equals or exist in a range of 5 (bigger or less) in one group, and so on.

Like in pic, i want a group for values between (90-100) , (100-110)…etc

Let’s say your ranges are consistently spaced by 10, you could use a math.floor operator on the result of dividing by ten. This can then serve as the key to group your original list of numbers by.

Thanks JacobSmall for your solution, but i think i need something more like:
If X=Y +/- (10) , sort it into groups !!!
but how to translate that to nodes language?!!!

Seems to work for me:


@maxy_13 You could try this for irregular ranges
In the example below 0-29,29-52,52-75,75-100
groupRanges.dyn (20.9 KB)