I have a table with positive and negative values in the same column and I need to order them so their sum at each row is closest to 0 and I need to do this based on article number.
For example, for article X I have the next order:
I need to rearrange it like this:
Thank you!
For example, for article X I have the next order:
Book2 | ||||
---|---|---|---|---|
C | D | |||
1 | Item no. | Value | ||
2 | 111 | 100 | ||
3 | 111 | 200 | ||
4 | 111 | -50 | ||
5 | 111 | -70 | ||
6 | 111 | -30 | ||
7 | 111 | -40 | ||
8 | 111 | -50 | ||
9 | 111 | -80 | ||
10 | 111 | -100 | ||
Sheet1 |
I need to rearrange it like this:
Book2 | ||||
---|---|---|---|---|
C | D | |||
12 | Item no. | Value | ||
13 | 111 | 100 | ||
14 | 111 | -50 | ||
15 | 111 | -70 | ||
16 | 111 | 200 | ||
17 | 111 | -30 | ||
18 | 111 | -40 | ||
19 | 111 | -50 | ||
20 | 111 | -80 | ||
21 | 111 | -100 | ||
Sheet1 |
Thank you!