objective is to balance positive and negative where sum is equal to zero.
for Example :
Input :
| row | Amount |
| 1 | 101.05 |
| 2 | -50.45 |
| 3 | -50.6 |
| 4 | 30.99 |
| 5 | 40.67 |
| 6 | 67.78 |
| 7 | -30.55 |
| 8 | -44.33 |
| 9 | -33.57 |
| 10 | 60.77 |
Expected output :
| row | Amount | type |
| 1 | 101.05 | balanced |
| 2 | -50.45 | balanced |
| 3 | -50.6 | balanced |
| 4 | 30.99 | |
| 5 | 40.67 | balanced |
| 6 | 67.78 | balanced |
| 7 | -30.55 | balanced |
| 8 | -44.33 | balanced |
| 9 | -33.57 | balanced |
| 10 | 60.77 | |
As shown in the expected output from row 1 to 2 sum is zero ( balance is done based on 1 : M combination , 1 positive and M negatives)
and from row 5 to 9 sum is zero ( balance is done based on M : M combination , Many positives and Many negatives)
I need to build a workflow which balances amount with combination
In the uploaded Excel, there are two datasets have been attached
Data set -2 is balancing correctly, giving the sum of amounts is zero
when i used same logic for data set-1, the sum of amounts is not equal to zero
is it possible to balance amounts without optimization tool