r/excel•
tangojoker

Distribute items by weight into buckets

unsolved

I am helping a friend to create a sheet to calculate items counts that can be placed in buckets such that the weight of the buckets is balanced (as much as possible)

Item Data Available

ItemCountWeight
A205
B1025
C1215
D540

Number of Buckets: 2 (for this example)

Max Bucket Count: 30 (for this example)

The Total Weight of items is 730

Based on the bucket count, we can place items into the two bucket as

ItemBucket 1Bucket 2
A614
B55
C66
D32

In this case each bucket weighs 365. Bucket 1 count is 20 and Bucket 2 count is 27

As the limit of the bucket is 30, we are good.

But if the bucket limit is 24, Bucket 2 should not be possible.The distribution may have to be something like

ItemBucket 1Bucket 2
A119
B55
C48
D32

Bucket 1 weight is 360 and Bucket 2 is 370 and the item counts in both are in the limit (24).

I think I can do this using a macro, but would like to know if it can be done using formula?

Posted Feb 22, 2016, 5:00 AM UTC

34
Loading comments…