Random Numbers based Upon Probability

IrishHawk01

New Member
Joined
Mar 20, 2014
Messages
4
I'm spinning wheels. Here is what I'm attempting

I'm trying to use the empirical discrete probability distributions to generate 1000 days of Widget sales and returns.

I need to use Nested IF statements to generate the 1000 days of sales. So for 1000 days, generate a number in a column that represents widget sales for that day based upon the given probabilities.

Number of Widgets SoldProbability
00.10
10.21
20.13
30.23
40.27
50.06

<tbody>
</tbody>
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Two step process here is probably easiest.

Post a version of your table such as the following:

00
0.11
0.312
0.443
0.674
0.945

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>
And then where you want the random numbers generated post this formula and copy down:

=VLOOKUP(RAND(),$A$1:$B$6,2,TRUE)

This will give the number of sales in column of your range above that is greater than or equal to the value in A and less than the next highest number in A.

Cheers, :)
 
Upvote 0
Shawn,

Thanks for the response. However, I was able to utilize that solution before and am comfortable with your proposed solution. Unfortunately, the requirement is that I use nested IF statements.

Here is what I have for the statement:

=IF(I2<$E$2,0,IF(I2<$E$3,1,IF(I2<$E$4,2,IF(I2<$E$5,3,IF(I2<$E$6,4,IF(I2<$E$7,5,))))))

I2 is the random number, and E is the probability listed below for each of the associated number of widgets. My logic is close but I've been staring at it too long and can't find my mistake. Any help would be greatly appreciated.

Number of Widgets SoldProbability
00.10
10.21
20.13
30.23
40.27
50.06

<tbody>
</tbody>
 
Upvote 0
Well, I really shouldn't help you with what seems like homework ;)

but try

=IF(I2<$E$2,0,IF(I2<$E$3+$E$2,1,IF(I2<$E$4+$E$3+$E$2 and so on...

Cheers, :)
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,029
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top