'Fun' Excel Data Analytics Puzzle

sjordan

New Member
Joined
May 4, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to automate a process and have tried various different platforms but seems that most roads lead to Excel. I'd like to take a column of numbers and group the 2 closest numbers that sum between 511 and 592. Once 2 numbers are grouped, they fall off the column of data and excel iterates through the remaining column data for the next highest group between 511 and 592. If there are no 2 numbers that add to between 511 and 592, I'd like to sum 3 numbers that add between 483 and 510. Again, once a number is grouped, it falls off the list and iterates through until no numbers are left that group between 483 and 510. Once there are no numbers that sum between 483 and 510, group 4 numbers together that sum between 420 and 483. If no numbers, group 5 numbers that sum less than 420. If there is 5 or less numbers left on the list, sum them. See example below.

IDNumberGroupSum of Group
1​
300​
1,2
580​
2​
280​
3​
270​
3,4
535​
4​
265​
5​
250​
5,7,28
502.5​
6​
220​
6,8,13
505​
7​
180​
8​
162.5​
9​
157.5​
9,10,17,27
482.5​
10​
150​
11​
140​
11,12,14,18
483​
12​
131.5​
13​
122.5​
14​
114​
15​
105​
16​
102.5​
17​
100​
18​
97.5​
19​
95​
19,23,24,25,26
420​
20​
92.5​
21​
90​
22​
87.5​
15,16,20,21,22
477.5​
23​
85​
24​
82.5​
25​
80​
26​
77.5​
27​
75​
28​
72.5​
29​
40​
30​
20​
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Similar threads

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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