# Equally distribute a list of values into n groups

I have a list of names and their frequency (count), and will be splitting the names in 8 different groups.

I want each group to have roughly the same number, so that a popular name "john" with 20, may end up getting it's own group, while 20 other infrequent names may be grouped together.

``````|  A   | B     | C    |
|______________________
| Name | Count | Group|
|______________________
| Joe  | 8     |   ?  |
| Bob  | 6     |   ?  |
| Derp | 1     |   ?  |
| ... +  40 others    |
``````

How can I have Excel find the best combination of 40 names, and group them together into n equally distributed groups so that the average of each group's total count will be roughly equal?

• The most easiest should be , put value in Column C and use Group & Subtotal,, or better share some sample data along with expected output, help us to apply another suitable method !! – Rajesh S Feb 15 at 6:08
• Distribution or group depends on number of values,, if you are thinking to restrict to 40 then what about other,, if JOHN if is more than 40 times? – Rajesh S Feb 15 at 6:17