Beetlestone
New Member
- Joined
- Jan 7, 2014
- Messages
- 2
I put this on a smaller scale of 28 rows to describe it easier.
This cannot be a macro (VBA), has to be a good old fashioned formula
I have 1 column (A) with 1254 cells, each cell contains tonnage. In column B, I am trying to create "buckets" of tonnage from column A that sum up to just below 10,000, and also distribute the same number of cells in each "bucket".
That means I cant simply add up consecutive cells (ex:B1 - B12 results in 9,841). Rather I need to efficiently distribute the tonnage so that each group (or bucket) has a similar number of cells in it.
Below column B is the result I am trying to achieve, any help on this is greatly appreciated!
[TABLE="width: 192"]
<tbody>[TR]
[TD="class: xl65, width: 64"][TABLE="width: 296"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Tonnage[/TD]
[TD]Bucket[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]634.9140625[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1729.05957[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]931.9863281[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1076.258789[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]417.0605469[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]332[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]601[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]827.4052734[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]494[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]2153[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]644.5859375[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]313[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]2084[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]1753.676758[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]1376.464844[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]5.655273438[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]1570[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]423[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]199[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]2122[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]1091.449219[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]0[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]2527[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]178[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]539.9375[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]699.5888672[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
This cannot be a macro (VBA), has to be a good old fashioned formula

I have 1 column (A) with 1254 cells, each cell contains tonnage. In column B, I am trying to create "buckets" of tonnage from column A that sum up to just below 10,000, and also distribute the same number of cells in each "bucket".
That means I cant simply add up consecutive cells (ex:B1 - B12 results in 9,841). Rather I need to efficiently distribute the tonnage so that each group (or bucket) has a similar number of cells in it.
Below column B is the result I am trying to achieve, any help on this is greatly appreciated!
[TABLE="width: 192"]
<tbody>[TR]
[TD="class: xl65, width: 64"][TABLE="width: 296"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR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]23[/TD]
[TD]1091.449219[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]0[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]2527[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]178[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]539.9375[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]699.5888672[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]