Spreadsheet: 368107d1420290436-how-to-divide-a-number-randomly-between-cells-371-cells
Sheet: Sheet1

2009-01-01 00:00:00 | 1
2009-01-02 00:00:00 | 1 |  |  |  | yellow range: "round" formulas, leave as is |  |  |  |  |  |  | aantal cellen | 371
2009-01-03 00:00:00 | 1
2009-01-04 00:00:00 | 1 |  |  |  |  |  |  |  |  |  | press F9 to generate random numbers (with limited variance as requested)
2009-01-05 00:00:00 | 1
2009-01-06 00:00:00 | 1
2009-01-07 00:00:00 | 1 |  |  |  |  |  |  |  |  | 1 | enter a number in B35, red cell, random numbers will be generated in B1:B34
2009-01-08 00:00:00 | 1
2009-01-09 00:00:00 | 1 |  |  |  |  |  |  |  |  | 2 | check sum B1:B34 in E35, green cell
2009-01-10 00:00:00 | 1
2009-01-11 00:00:00 | 1 |  |  |  |  |  |  |  |  | 3 | if this sum in E35 displays a value 1 or 2 lower than B35, select the lowest of the bluecolored cells (with "roundup" formula) in column B, and drag down the fillhandle 1 or 2 rows, thus setting E35 to the correct value
2009-01-12 00:00:00 | 1
2009-01-13 00:00:00 | 1 |  |  |  |  |  |  |  |  | 4 | if the sum in E35 displays a value 1 or 2 higher than B35, select the highest of the pinkcolored cells (with "rounddown" formula) in column B, and drag the fillhandle up 1 or 2 rows, thus setting E35 to the correct value
2009-01-14 00:00:00 | 1
2009-01-15 00:00:00 | 1
2009-01-16 00:00:00 | 1 |  |  |  |  |  |  |  |  |  | extend the range (column B) for example from 34 to 50
2009-01-17 00:00:00 | 1
2009-01-18 00:00:00 | 1 |  |  |  |  |  |  |  |  | 1 | in the "yellow" type formulas : replace the number 34 with number 50, replace 136 (=34*4) with 200 (50*4)
2009-01-19 00:00:00 | 1 |  |  |  |  |  |  |  |  | 2 | enter this formula in the first half of the new range (B1:[NAME] if total range is 50 rows)
2009-01-20 00:00:00 | 1 |  |  |  |  |  |  |  |  | 3 | in the "blue/pink" type formulas  : replace the number 17 (34/2) with number 25 (50/2),
2009-01-21 00:00:00 | 1 |  |  |  |  |  |  |  |  | 4 | fill the first half of B26:B50 with the "blue" type roundup formulas, second half of B26:B50 with "pink" type rounddown formulas.
2009-01-22 00:00:00 | 1 |  |  |  |  |  |  |  |  | 5 | check the sumB1:[NAME] ("green" cell) and adapt the percentage of roundup/rounddown formulas to set the "green" cell sum to the correct value (="red"cell)
2009-01-23 00:00:00 | 1 |  |  |  |  |  |  |  |  | 6 | the conditional formatting (giving the blue and pink color distribution) is not really necessary and very tricky to explain, maybe later.
2009-01-24 00:00:00 | 1
2009-01-25 00:00:00 | 1
2009-01-26 00:00:00 | 1
2009-01-27 00:00:00 | 1
2009-01-28 00:00:00 | 1
2009-01-29 00:00:00 | 1
2009-01-30 00:00:00 | 1
2009-01-31 00:00:00 | 1
2009-02-01 00:00:00 | 1
2009-02-02 00:00:00 | 1
2009-02-03 00:00:00 | 1
TOT: | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 1
 | 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