+ Reply to Thread
Results 1 to 5 of 5

Excel RANDBETWEEN with probability

Hybrid View

  1. #1
    Registered User
    Join Date
    05-22-2015
    Location
    Munich
    MS-Off Ver
    2013
    Posts
    5

    Unhappy Excel RANDBETWEEN with probability

    Hi, this question would be quite similar to the one already asked here.

    I would like to randomly choose a number from the following set (0,1) i.e. either a 0 or a 1, but with the following probabilities assigned:
    0 - 20%
    1 - 80%

    I had a look at the above mentioned thread and following is what I could come up with:
    =CHOOSE(MATCH(RAND(); {0;0,8}); RANDBETWEEN(0;1))

    This certainly produces incorrect results. Where am I going wrong?

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Excel RANDBETWEEN with probability

    =if(rand()<=0.8,1,0)
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    05-22-2015
    Location
    Munich
    MS-Off Ver
    2013
    Posts
    5

    Re: Excel RANDBETWEEN with probability

    Thank you mikeTRON! But what if I have more than two numbers that I need to assign a probability to? Say:
    0 - 20%
    1 - 30%
    2 - 10%
    4 - 40%

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Excel RANDBETWEEN with probability

    Try..

    =LOOKUP(RAND(),{0,0.2,0.5,0.6},{0,1,2,4})
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    05-22-2015
    Location
    Munich
    MS-Off Ver
    2013
    Posts
    5

    Re: Excel RANDBETWEEN with probability

    Thanks, works perfectly!

+ 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] Randbetween exactly some values in excel ?
    By Mr.Nob0OOdy in forum Excel General
    Replies: 5
    Last Post: 06-23-2015, 05:49 AM
  2. Replies: 7
    Last Post: 07-19-2010, 02:03 PM
  3. excel how use numbers as probability
    By acerf1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-19-2006, 07:55 AM
  4. Probability Question:probability outcomes
    By Myles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 06:45 AM
  5. [SOLVED] [SOLVED] Creating a merged probability table from a granular probability table
    By misterhanky@gmail.com in forum Excel General
    Replies: 1
    Last Post: 09-08-2005, 10:05 PM

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