Hi, I'm currently working on a table that includes NetValue, BookValue, and GainLoss (where NV - BV = GL). I need to allocate these values according to a specific ratio, rounding to the nearest whole number.
The problem arises due to the total rounding of values, which will be manually adjusted by a maximum increment of +/- 1 to negate the variance from the original totals. Ideally, I will first check the rows for any variance, then adjust the columns. If there is variance in both, it's a good indicator that the intersected cell should be adjusted.
I'm exploring the Optimization tool but I'm struggling to determine the correct input values for each anchor to make this work. I will be using the Optimization tool to determine the appropriate adjustments.
Input:
| | | NetValue | BookValue | GainLoss | |
| | Original | 4250.00 | 3000.00 | 1250.00 | |
| | | | | | |
| | Ratio | | | | Check |
| A | 11.80% | 502.00 | 354.00 | 148.00 | 0.00 |
| B | 21.00% | 893.00 | 630.00 | 263.00 | 0.00 |
| C | 0.00% | 0.00 | 0.00 | 0.00 | 0.00 |
| D | 26.20% | 1114.00 | 786.00 | 328.00 | 0.00 |
| E | 41.00% | 1743.00 | 1230.00 | 513.00 | 0.00 |
| | 100.00% | 4252.00 | 3000.00 | 1252.00 | |
| | Check | -2.00 | 0.00 | -2.00 | |
Desired output:
| Ratio | NetValue | BookValue | GainLoss |
| 11.80% | 501.00 | 354.00 | 147.00 |
| 21.00% | 892.00 | 630.00 | 262.00 |
| 0.00% | 0.00 | 0.00 | 0.00 |
| 26.20% | 1114.00 | 786.00 | 328.00 |
| 41.00% | 1743.00 | 1230.00 | 513.00 |
| 100.00% | 4250.00 | 3000.00 | 1250.00 |