probability in data analysis (please help)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

my question is as follows: in Excel i am trying to figure out if there is a function that will do the following for me - if i have a number in column A, in column B i want to have a split-function that will return a value that depends on A a certain percentage of the time (say 2/3) and will return a different value (different function) that depends on A a different percentage (1/3 in this case). then i want to repeat this say 5,000 times so it runs like a simulation. is it possible to do this. thanks so much in advance......
 
=INT(RAND()*2.9)+1
will give you a randow number between 1 and 3, combine
that with an If

=IF(int(rand()*2.9)+1<3, "Do 2/3", "Do 1/3")

and you may have your answer. Problem is that RAND is
volatile. Every time the worksheet recalculates, RAND
recalculates, this may be an advantage (particularly if
you turn off auto-recalc and use F9 to force recalc).
Otherwise to make your RANDom numbers static you may need
to generate the list and copy/Paste Special/values

Steve
-----Original Message-----
my question is as follows: in Excel i am trying to
figure out if there is a function that will do the
following for me - if i have a number in column A, in
column B i want to have a split-function that will return
a value that depends on A a certain percentage of the
time (say 2/3) and will return a different value
(different function) that depends on A a different
percentage (1/3 in this case). then i want to repeat this
say 5,000 times so it runs like a simulation. is it
possible to do this. thanks so much in advance......
 
=INT(RAND()*2.9)+1
will give you a randow number between 1 and 3, . . .
...

True, but it won't be uniform. The odds will be 10/29 each for 1 and 2, and 9/29
for 3. For a discrete uniform distribution, use INT(3*RAND())+1. Note that
RAND() is always strictly < 1, so INT(3*RAND())+1 will never be 4 if that was
what you were trying to achieve with 2.9.
 
Back
Top