
Originally Posted by
ixander
i would like to generate random number from column D with effect on the probability from column A

Originally Posted by
joeu2004
Much ado about nothing, perhaps.
Indeed! I awoke this morning realizing that ixander probably misunderstood the assignment. Refer to the table below, which summarizes and embellishes ixander's JPEG and my attached Excel file.
Ixander probably needs to generate the demands in column B (B3:B8) according to the probability distribution in column A (A3:A8). Notice that the ultimate objective is to simulate demand starting in C11.
Someone might have told ixander to accomplish that by using RANDBETWEEN to generate integers in corresponding ranges (D1:D8, which are not needed for my purposes). That is a misdirection. But if the assignment requires that, I will explain how to change the paradigm below to that end.
The table below shows one way to simulate demand in rows 11 through 10011 (excerpted).
|
A
|
B
|
C
|
D
|
E
|
F
|
G
|
1
|
Prob
|
Demand |
Cuml Prob |
Rnd Intvl
|
|
|
|
2
|
|
|
0.00% |
|
|
|
|
3
|
5.00% |
0 |
5.00%
|
1 to 5
|
|
|
|
4
|
10.00% |
1 |
15.00% |
6 to 15 |
|
|
|
5
|
20.00% |
2 |
35.00% |
16 to 35 |
|
|
|
6
|
30.00% |
3 |
65.00% |
36 to 65 |
|
|
|
7
|
20.00% |
4 |
85.00% |
66 to 85 |
|
|
|
8
|
15.00% |
5 |
100.00% |
86 to 100 |
|
|
|
9
|
|
|
|
|
|
|
|
10
|
Day
|
Rnd# |
Sim Demand |
|
Demand |
Freq |
Prob |
11
|
1 |
0.9242114 |
5 |
|
0 |
479 |
4.79% |
12
|
2 |
0.8095377
|
4 |
|
1 |
1021 |
10.21% |
13
|
3 |
0.2860609 |
2 |
|
2 |
1958 |
19.58% |
14
|
4 |
0.2308978 |
2 |
|
3 |
3078 |
30.78% |
15
|
5 |
0.8072394 |
4 |
|
4 |
1969 |
19.69% |
16
|
6 |
0.8546513 |
5 |
|
5 |
1495 |
14.95% |
17
|
7 |
0.8199888 |
4 |
|
TOTAL
|
10000 |
|
18
|
8 |
0.0187098 |
0 |
|
|
|
|
19
|
9 |
0.3324532 |
2 |
|
|
|
|
|
etc
|
etc
|
etc
|
|
|
|
|
Formulas displayed with curly brackets {...} are array-entered, to wit: type the formulas without the curly brackets, then press ctrl+shift+Enter instead of just Enter. Excel displays the curly brackets in the Formula Bar to indicate that the formula is array-entered.
The frequency distribution table in E11:G16 demonstrates the probability distribution for the simulation, which is similar to A3:A8.
If the assignment requires that the random numbers starting in B11 be integers 1 through 100, make the following changes with appropriate changes to cell formats and column titles (ERRATA in red):
Bookmarks