# Grouping ranges

I have this set of numbers, that is a range of prices (ie 6-10) and a quantity of products (5)

6 - 10:   5
11 - 15:   8
16 - 20:   15
36 - 40:   63
41 - 45:  1
46 - 50:  1
51 - 55:  5
56 - 60:  3
61 - 65:  140
66 - 70:  120
71 - 75:  95
86 - 90:  2
91 - 95:  2
96 - 100:  12
101 - 200:  150
201 - 300:  300
301 - 400:  1
401 - 500:  1
501 - 600:  1
601 - 700:  1
1201 - 1300: 1
1301 - 1400: 1


And I want to obtain ranges like this ones

0 - 60:  111
61 - 65:  140
66 - 70: 120
71 - 100:  111
101 - 200: 150
201 - 300: 300
301 - 1400 : 6


The idea is to obtain less ranges, with similar quantities (grouping the original ones).

Is there any way to do this for any set of ranges? How can I handle the deviation when one number is too high?

-
Please expand your question a bit more, providing more context. It is not clear (at least to me) what you are asking. –  vz0 May 3 '13 at 20:17