+ Reply to Thread
Results 1 to 6 of 6

Random outcome generator based on Probability

Hybrid View

  1. #1
    Registered User
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    2008
    Posts
    9

    Random outcome generator based on Probability

    I'm new here and I was hoping one of the site experts would be able to help me out. Apologies in advance for any lack of etiquette.

    So I'm trying to build a simple Excel random outcome generator based on probability. For example, lets say a horse race with 8 runners (ie. potential outcomes) let's call them Horse 1 - Horse 8 for simplicity.

    Each horse has an implied probability of winning between 0% and 100%.

    I want to be able to create a formula that will return a single "random" result in to a designated cell based on the probability entered for each horse prior to refreshing.

    Is there a simple way to do this by putting the horses in column A, then the probabilities in column B and running the formula?

    Thanks in advance.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random outcome generator based on Probability

    Welcome to the board.

    One way:

    Row\Col
    A
    B
    C
    D
    E
    1
    Horse
    Prob
    Cumu
    2
    Alan
    12%
    0%
    C2: =SUM(B$1:B1)
    3
    Barb
    14%
    12%
    4
    Cain
    5%
    26%
    5
    Dana
    19%
    31%
    6
    Eric
    9%
    50%
    7
    Fran
    22%
    59%
    8
    Gary
    14%
    81%
    9
    Hana
    5%
    95%
    10
    11
    Gary A11: =INDEX(A2:A9, MATCH(RAND(), C2:C9))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Random outcome generator based on Probability

    Hi, welcome to the forum.

    If I understand you correctly, you want to be able to enter a percentage chance of each horse winning, then have a formula which generates a winner, which changes whenever you update the chances?

    This will do something like it:
    1. Put your horse names in column A - Horse1, Horse2,..., Horse8.
    2. Enter probabilities into column B - lets say 10,50,70,25,30,80,65,35
    3. In C1, enter this:
    Formula: copy to clipboard
    =RANDBETWEEN(B1-10,B1+10)

    then drag that down to C8. This will generate a random number from 10 lower than the number you entered in B to 10 higher - so 50 could become anything from 40 to 60.
    4. In D1, enter this:
    Formula: copy to clipboard
    =INDEX(A1:A8,MATCH(MAX(C1:C8),C1:C8,0))

    This will check which of the randomly generated numbers is highest and give you the name of the horse that matches.

    The bigger the 'difference' you provide in step 2 (changing B1-10,B1+10 to B1-20,B1+20 for example), the more random the final result will be. The formula in step 2 won't ever return a negative number.

    Every time you change something on the sheet, the formulae will update - if you want to re-run it without changing any of your numbers, press F9 to manually re-calculate.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

  4. #4
    Registered User
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    2008
    Posts
    9

    Re: Random outcome generator based on Probability

    Thanks very much to both of you. I've implemented both methods and they both work nicely.

    Just for your own amusement, the reason I'm doing this is because I have a few friends who like a bet on the horses, and every now and then convince themselves they've found a tipster who is the messiah. Knows what others don't, can tell the future etc etc!

    I know that if there was any such person, who could consistently predict winners in any form of sport (especially horse racing), they would either keep very quiet about it and retire to the Bahamas before too long, or they would want a fortune for their services. They probably wouldn't be involved in excessive and highly suspicious forms of self promotion on Facebook, claiming they win thousands every day with "evidence" that a 5 year old with photoshop could fabricate in order to receive $10/month from punters for their knowledge. But when I point this out I am called cynical.

    So I thought one way to debunk (or maybe prove!) the myth than by pitting the self proclaimed knowledge of this particular tipster with hundreds of thousands in claimed winnings, and years of experience, against a humble excel formula based on nothing more complicated than the book makers odds, and random chance.

    I'd be happy to share the results with anyone who is interested!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random outcome generator based on Probability

    You're welcome.

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Random outcome generator based on Probability

    You're welcome - good to see Excel being used in the cause of debunking bad statistics...

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Generating random outcomes based on probability
    By JP2008 in forum Excel General
    Replies: 9
    Last Post: 12-07-2015, 04:48 AM
  2. Random Number Generator based on specific constraints
    By redstar15 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2014, 03:49 PM
  3. Replies: 0
    Last Post: 04-20-2013, 07:17 PM
  4. Need Random Number Generator but with Weighted Probability for Certain Numbers...
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-13-2012, 03:52 PM
  5. Need Help with a Random Number Generator with Weighted Probability for Certain Numbers
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 02:48 PM
  6. Return random number based on probability
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-28-2011, 08:46 PM
  7. Random outcome based on set criteria on refresh
    By RamboDanbo in forum Excel General
    Replies: 2
    Last Post: 02-16-2011, 02:15 PM
  8. Number probability outcome
    By right_hand_of_doom in forum Excel General
    Replies: 4
    Last Post: 06-26-2009, 01:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1