How to sort a four-column database into groups by sums of 30 found from the fourth column?

I have an excel database with four columns (A, B, C, D). The fourth column (D) has integers. I want to know how to sort the data by summed groups of 30 from the data in D.

For example this data:

Four columns with the first three columns of unnecessary data and the fourth column containing (7,5,6,4,12,9,8,9)

I want sorted to become

Two groups with the first group (7,5,6,12) and the second (9,8,9,4). The data in the previous three columns of course is preserved and follows their respective numbers.

Please let me know how I can do this. Even though my images are of Excel 2003, I have access to higher versions.

Thank you!

Answer

That’s not ‘sorting’, but a much more complex problem.

It probably is NP-hard, meaning there is no general computational algorithm even possible (expect brute-force trials). No way to do in Excel without extensive coding.

Attribution
Source : Link , Question Author : BMENRohan , Answer Author : Aganju

Leave a Comment