+ Reply to Thread
Results 1 to 3 of 3

Having something happen randomly a given percentage of the time

  1. #1
    Registered User
    Join Date
    07-23-2020
    Location
    United States
    MS-Off Ver
    16.39
    Posts
    3

    Having something happen randomly a given percentage of the time

    Hello. This is my first time posting. Hope I'm doing this right.

    Is there a way to write a formula so that one outcome happens randomly a given percentage of the time and another outcome happens the rest of the time?

    For example, I want the number 1 to appear 40% of the time and the number 2 to appear 60% of the time. Obviously this would be imbedded in a larger formula.

    If this is possible, how do I do it?

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Having something happen randomly a given percentage of the time

    Try for first case:

    Please Login or Register  to view this content.
    Copy to next cell for second case.

    It is so hard to test, because of value change continously, so you can change the % upto 80 or even 100% to test.

    Clarafication:

    With 40% in B2, 1 in B1, mean the last 19 number will be 60%.
    The total of number now should be : ROUND((COUNT($A$3:$A$22)-1)/(1-B$2)=19/60%=32
    with 23 of "1" and 19 of the rest
    Now the RANDBETWEEN returns random number between 1 and 32
    From 1-20 (occupy 60%): get random number in A3:A22
    From 21-32 (occupy 40%): get number "1"

    Hope it is clear enough for you.
    Quang PT

  3. #3
    Registered User
    Join Date
    07-23-2020
    Location
    United States
    MS-Off Ver
    16.39
    Posts
    3

    Re: Having something happen randomly a given percentage of the time

    Thank you!

+ 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. Events that happen in certain time window
    By Bernie Madoff in forum Excel General
    Replies: 5
    Last Post: 01-10-2015, 07:08 AM
  2. [SOLVED] Count instances that happen within time range
    By Abarency in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-12-2013, 08:04 PM
  3. Replies: 0
    Last Post: 03-31-2006, 01:10 AM
  4. Replies: 0
    Last Post: 03-31-2006, 12:50 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