How to split a google sheet range into parts by sum
问题 I have a three column sheet: Name (ID), Length (Timespan), Category (Arbitrary, could be sequence). I would like to automatically fill the Category column with values such that each category will have the same sum of the Length column. Currently I am splitting the category column evenly using the formula =TRANSPOSE(SPLIT(JOIN(",", ARRAYFORMULA(REPT(G2:G9&",", H2))), ",")) which I have copied from this site. Since the Length column varies by a lot I get categories that are of much different