I use the RANDBETWEEN(;) to find random numbers of oil of a month that each number has to be up to 500 litters. The total amount of oil I have used, in a month is eg 7000 liters and I want to find how much oil I used for each day. Everyday has to have different numbers and their sum has to be the standard total I already have which is eg 7000 liters. How I can do this automatically in excel? And I have to calculate this for every month in one year...
This is for a 31 day month.
In A1 thru A31 enter =RANDBETWEEN(1,500)
In A32 enter: =SUM(A1:A31)
A1 thru A31 are random samples, but may not have the proper sum so:
In B1 enter: =ROUND(A1*7000/$A$32,0)
and copy down thru B30
Finally in B31 enter: =7000-SUM(B1:B30)
B1 thru B31 represent 31 random samples that will sum to 7000.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.