Excel Formula

Copper Contributor

I am trying to create a formula so that I can plug in 12 to 20 numbers and it puts them in groups of 4 that all equal the closest number possible. By the same number I mean that once the groups are made the mean of each group is approx the same. Just need to be able to plug in any sort of numbers and it be able to split them evenly into groups of four

1 Reply

@chphipps 

Is this an optimisation exercise in which you need to be sure there is no other grouping with a smaller spread of mean values or is the aim just to have a reasonable expectation that the spread will be small?

If the latter, you could sort the numbers and then group them by a sequence such as

{a, b, c, d; d, c, b, a; a, b, c, d; d, c, b, a}

image.png

The chart shows (orange) numbers picked out at random versus (blue) numbers picked by their place in the ordered sequence.