![]() |
#2
|
||||
|
||||
![]()
That is INTERESTING, acbh! I don't even care why you want such an outlandish thing, it's just fascinating to think about it.
Ok, first let me reproduce your sample in a fixed-spacing font so I can see it clearly: Code:
I J ---- ---- 3 6000 4 5 6 1505 rand 7 5625 rand 8 2568 rand 9 3256 rand The other three numbers must be random, but they must not be allowed to be so small that their sum is less than J$3-I$9. Let's see, a random number for any row is too small if it, plus all the random numbers below it, plus all the maximum allowed numbers for the rows after it, will still be less than J3. So the bottom value for J7 (for example) is "=J$3-SUM(I8:I$9)-SUM(J$6:J6)". No, wait, it has to start below J6. So what happens if we use this for J6:J8? Code:
=RANDBETWEEN(J$3-SUM(I8:I$9)-SUM(J$5:J6),$I7) It isn't necessarily the best answer. It could be you won't care for the distribution, too many high numbers at the top and too many low ones at the end, or something. But I'll start by claiming to have found what you want. If you want to improve on it, for example by forbidding negative numbers, speak up and let's see where this goes from here. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
OTPM | Excel | 2 | 05-22-2013 06:28 AM |
Formula Help | OTPM | Excel | 5 | 02-21-2013 08:03 AM |
![]() |
AndrewSE | Excel | 3 | 04-05-2011 08:50 PM |
![]() |
sixhobbits | Excel | 1 | 10-02-2009 08:02 AM |
Help for formula | dehann | Excel | 5 | 05-01-2009 10:44 AM |