+ Reply to Thread
Results 1 to 6 of 6

Need to generate choices with an assigned probability

  1. #1
    Registered User
    Join Date
    11-10-2013
    Location
    sueanho
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need to generate choices with an assigned probability

    Lets say I have 20 cells. I want to randomly assign a label to the each cell from 5 choices, like "Blue", "Orange", "White", "Green", and "Black". But I want to assign a probability of selecting the
    labels. So the percent probability of choosing Blue would be 56% and White would be 23%, etc. . .
    is there a function that allows me to do this?

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

    Re: Need to generate choices with an assigned probability

    A
    B
    C
    D
    1
    Color
    Prob
    Cumu
    2
    Blue
    10%
    0%
    C2: =SUM(B1:C1)
    3
    Orange
    15%
    10%
    4
    White
    20%
    25%
    5
    Green
    35%
    45%
    6
    Black
    20%
    80%
    7
    8
    Black A8: =INDEX($A$2:$A$6, MATCH(RAND(), $C$2:$C$6))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-10-2013
    Location
    sueanho
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need to generate choices with an assigned probability

    Could you explain what you did? I don't understand the functions and the setup of the table.

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

    Re: Need to generate choices with an assigned probability

    Column A lists the colors and B their probabilities.

    Column C creates a lookup table as the cumulative probabilities of selecting colors.

    The formula in A8 calculates a random color by matching a random number into the lookup table.

  5. #5
    Registered User
    Join Date
    11-10-2013
    Location
    sueanho
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need to generate choices with an assigned probability

    Awesome. Thanks.

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

    Re: Need to generate choices with an assigned probability

    You're welcome.

+ 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. [SOLVED] Generate random number from probability
    By shinzai in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2013, 11:53 AM
  2. Replies: 1
    Last Post: 03-26-2013, 02:24 PM
  3. Drop-down list choices restricting choices of other lists?
    By not_quite_excelling in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2011, 06:04 AM
  4. generate numbers given probability of outcomes
    By jerdjets in forum Excel General
    Replies: 5
    Last Post: 11-15-2007, 07:25 AM
  5. Probability Question:probability outcomes
    By Myles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 06:45 AM

Tags for this Thread

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