View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Divide number and add remainder in another cell

"rhon101" wrote:
Here is my formula;
=IF(E18=0,0,IF(I19250,50,(I19/(E8+E9+E10+E16)*E18)))

column E =# of hours working for each employee,
I19 = total number of claims.
If the total number of claims is 1500 and there are 5 people

working it returns 50 to the E18 employee and 363 to the rest,
but this adds up to 1502 instead of 1500.


Such "quantization errors" are common whenever you
round/truncate floating-point computations to integral
values.

I want it to distribute 50, 362, 362, 363 and 363. Any advice?


I would put a different formula in each employee's cell.
I started with E18, the employee whose hours limited.

E18: =MIN(50,I19/5)
E8: =ROUND((I19-E18)/4,0)
E9: =ROUND((I19-E18-E8)/3,0)
E10: =ROUND((I19-E18-E8-E9)/2,0)
E16: =I19-E18-E8-E9-E10

When I19 is 1500, that yields the assignments 50, 363,
362, 363 and 362 respectively.