Hi All,
Could I please request your help with building a workflow to process the dataset below?
What I want to achieve is: offset the positive values (from right to left) using the first negative value found from the right. The goal is to turn the positive values into zero by deducting the negative amount, and leave any remaining negative balance in its original column.
For example, in the case below, the value -750 will first offset 2805.95, making it 0, and the resulting cell will contain 2805.95 - 750.
If -750 was a larger value, it would offset 2805.95 first, then move on to 4906.7, continuing until the negative amount is fully used or no more positive values are available.
Thanks in advance
Input sample -
| A | B | C | D | E | F | G |
| 0 | 0 | 0 | -444 | 0 | 0 | 64.43 |
| 0 | 0 | 0 | 0 | 0 | 1182.98 | -54 |
| 0 | 0 | 679.76 | 0 | 0 | 0 | -1577.81 |
| 0 | 5647 | 0 | 0 | 0 | 0 | -614.83 |
| 0 | 0 | 1240 | 0 | 0 | 0 | -3120 |
| 0 | 0 | 367 | 0 | 0 | -6500 | 0 |
| 0 | 0 | 0 | 0 | 0 | -2484 | 1930.7 |
| 236.4 | 0 | 0 | 0 | 0 | 155 | -11640.75 |
| 0 | 0 | 0 | 55 | 0 | -55.1 | 0 |
| 0 | 0 | 0 | 0 | 0 | -1543.1 | 225 |
| 0 | 0 | 0 | 0 | 0 | 78 | -225 |
| 0 | 0 | 0 | 0 | 0 | 631.14 | -577.67 |
| 0 | 0 | 1884 | 0 | 0 | 0 | -4466 |
| 0 | 0 | 0 | 0 | -166.04 | 177.39 | 0 |
| 18 | -6 | 0 | 0 | 0 | 0 | 0 |
| 4906.7 | 2805.95 | 0 | 0 | -750 | 0 | 0 |