Forum Discussion
Remya Ramakrishnan
Feb 09, 2018Copper Contributor
Divide a quantity as whole number among multiple cells
Hello,
Any suggestion for an excel formula to derive A2, B2, C2, D2 values.
Eg:
Category
Income
A
B
C
D
Sal1
11
3
3
3
2
if we divide 11 among 4 c...
- Feb 09, 2018
=MIN(IF(COLUMN()=3,$B2,$B2-SUM($C2:OFFSET(C2,0,-1))), ROUNDUP($B2/(SUMPRODUCT(NOT($1:$1=0)*1)-2),0))
Willy Lau
Feb 09, 2018Steel Contributor
This is what I guess you want
=ROUNDUP(IF(B2=$B2,$B2,$B2-SUM($C2:OFFSET(C2,0,-1)))/(SUMPRODUCT(NOT($1:$1=0)*1)-COLUMN(B2)),0)
Assume that you enter the formula at C2, and copy & paste the formula to the cells you need it. If later on, you want E, F, G etc., you just need to add the headers and paste the formula.
Eg:
Category | Income | A | B | C | D |
something | 6 | 2 | 2 | 1 | 1 |
another thing | 5 | 2 | 1 | 1 | 1 |
Rups_S
Oct 23, 2019Copper Contributor
Willy,
It’s a while since you posted this solution - I’ve successfully used your formula, but would there be a way of adjusting it to set a maximum permissible value? I.e. in your example A, B, C etc could be no greater than 8.
Cheers
It’s a while since you posted this solution - I’ve successfully used your formula, but would there be a way of adjusting it to set a maximum permissible value? I.e. in your example A, B, C etc could be no greater than 8.
Cheers