Forum Discussion
Divide a whole number by a varying quantity across multiple cells
- Feb 10, 2022
Hi DianneTS
this is a tricky one...
In my solution, you would need two different formulas:
One for the first column (in my example column E) and one for all the other columns.
E2: =IF(E$1<=$C2;"";$B2)
F2: =IF(SUM($E2:E2)=$A2;"";IF(F$1<=$C2;"";IF(AND($A2-SUM($E2:E2)<=$A2;$A2-SUM($E2:E2)>=$B2);$B2;IF($A2-SUM($E2:E2)<$A2;MOD($A2;$B2);""))))
You might need to replace the ; with , depending on your regional settings.
Hi DianneTS
this is a tricky one...
In my solution, you would need two different formulas:
One for the first column (in my example column E) and one for all the other columns.
E2: =IF(E$1<=$C2;"";$B2)
F2: =IF(SUM($E2:E2)=$A2;"";IF(F$1<=$C2;"";IF(AND($A2-SUM($E2:E2)<=$A2;$A2-SUM($E2:E2)>=$B2);$B2;IF($A2-SUM($E2:E2)<$A2;MOD($A2;$B2);""))))
You might need to replace the ; with , depending on your regional settings.