Forum Discussion

DianneTS's avatar
DianneTS
Copper Contributor
Feb 09, 2022
Solved

Divide a whole number by a varying quantity across multiple cells

Good Afternoon,   I'm looking for a formula that will allow me to divide a whole number by another cell with a quantity that can be varied and for the results to be displayed in multiple cells also...
  • Martin_Weiss's avatar
    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.

Resources