答案1
使用最小二乘法通过规划求解进行求解。
A2:B7, F1 - source data
C2:C7 - the result (initial values are 1 for all cells)
公式:
B8=SUM(B2:B7)
F2=ROUND(B8/F1,0)
F3=B8/F2
H2=IF(ROW()>$F$2+1,"",ROW()-1) - drag down till H7
I2=SUMIF($C$2:$C$7,H2,$B$2:$B$7) - drag down till I7
J2=IF(I2=0,0,(I2-$F$3)^2) - drag down till J7
J8=SUM(J2:J7)
求解器参数:
Optimization: $J$8 => minimal value
Altered cells: $C$2:$C$7
Restrictions: $C$2:$C$7 is integer
$C$2:$C$7 >= 1
$C$2:$C$7 <= $F$2
屏幕截图上找到的解决方案。