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:

I want sorted to become

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!