Dividing rows into groups based on two parameters

thomazzs

New Member
Joined
Jun 14, 2014
Messages
15
Dear all,

I have the following problem: I need to divide the rows below into groups, based on two criteria.

e.g. The sum of Balls <= 10.000 & the sum of Bucket <= 5

the order of the rows cannot change.

Is there an (easy) way to let excel determine these groups?


the result in the row "group" would (for this example) be as follows:

[TABLE="width: 336"]
<tbody>[TR]
[TD]Order[/TD]
[TD]Balls[/TD]
[TD]Bucket[/TD]
[TD]Group[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]5037[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2601[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1584[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1534[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]3133[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]9002[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]7[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]15[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]14[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]20[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 336"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I can't see from that example what Bucket has to do with it.
This formula in D2, copied down produces those results.
If this is not what you need, perhaps another example that demonstrates all the possibilities and further explanation may help.

Excel Workbook
ABCD
1OrderBallsBucketGroup
21503711
32260111
43158411
54153412
65313322
76900213
87713
981513
1091413
11102013
Groups
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top