Ben,
The last condition of not exceeding 50 will be challenging.
The random part can be handled by doing something like, if(rand()<0.2, 4,0).
So now if the randomly created number is less than 0.2, 4 is entered. But
now you want to see if the column adds to less than 50. You can't create a
circular loop. So you must look at the preceding cells and total those
numbers up to see if it is less than 50.
For example, let's say you are using A1:A15.
In cell A14, the formula was, if(sum(A1:A13)>=50,0, if(rand()<0.2, 4,0)).
The problem with this formula is that things are no longer random. The last
few cells in the row have a larger chance of being zero than do the first 12
cells (12*4=48, which is less than 50). Thus your desire for randomness is
broken.
Anyway, I hope this provides some food for thought. Perhaps there is
another method where you could randomly "turn off" certain cells if the
total value exceeded 50?
Good luck.
Regards,
Kevin
Ben said:
I have a predetermined # that I need to spread over a certain # of cells
in a range of cells. For instance I have a range of 15 cells in a row, I
have the number 4 that I need to spread over these cells, but I need it done
randomly and also the sum of the column once randomly spread cannot exceed a
sum of 50.