Please Help: Sort value columns into the adjacent cell group that sum less than a specified number

Copper Contributor

Hello, 

 

I have a sheet that have two columns: Width (column F) and Length (column G) in millilitres of the list of wall paper parts need to be cut in many finished dimensions. The non-cut wall paper dimension has maximum width 1370mm.

For optimized cutting, I need to organize other finished dimensions into many groups that have the same length and each group will have the width sum result of all parts equals or less than 1370mm and the same length. 

One way I can think is sort the rows that have the width sum equal or less than 1370mm. And the cell of the specified group locates adjacent to other cells of the same group. 

In the attached file, you can see the result that I did manually and want to look like this in Row 4 and Row 5. They have the width sum less than 1370mm and have the same length 4750mm

Can anyone help please?

 

Thank you

 

Khanh Mai

 

 

1 Reply

@Khanh_MaiUnder data sort I would sort by col G (length) first and then by col F (width) from largest to smallest next.  Then I go down the list from larger widths down and move the "smaller" widths up to be next to them.  You could make a 'helper' column that helps you know how much is "left" for the width so you don't have to do as much math, but to create a formula based sorting algorithm with basically AI in it to group the parts this way … I don't see it.