Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to generate random value based on assigned probability in Excel?

If there is a table with some values and corresponding assigned percentages as below screenshot shown in a sheet. And now, I want to generate random values based on the list of values and their assigned probabilities.
doc random with probability 1

Generate random value with probability

arrow blue right bubble Generate random value with probability

In fact, to generate random values with the probability, you only need two formulas.

1. In adjacent cell of the table, type this formula =SUM($B$2:B2), and drag this formula down to the cells you need. See screenshot:
doc random with probability 2

2. Select a blank cell which you will place the random value at, type this formula =INDEX(A$2:A$8,COUNTIF(C$2:C$8,"<="&RAND())+1), press Enter key. And press F9 key to refresh the value as you need.
doc random with probability 3

Relative Articles:

Relative Utility

Insert Random Data

Here the Insert Random Data of Kutools for Excel can help you quickly insert random unique integer, date, or random time, text string, custom list as you need.
excel addin tool for generate random integers dates times strings custom lits

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Chudi · 7 months ago
    Sorry Just Noticed that I extend the cumulative prob. outside the desired limits
  • To post as a guest, your comment is unpublished.
    Chudi · 7 months ago
    Does this work if the data in the cells are horizontal instead of vertical? Mine is not. Thanks
  • To post as a guest, your comment is unpublished.
    Maria · 7 months ago
    Hello, can anyone help me getting the correct formula? I would like to get random values but with certain limits. For example, randomly get "red, blue, green, orange or pink", but I have a specific quantity of items for each color so I have to set this condition within the formula.
    • To post as a guest, your comment is unpublished.
      Sunny · 6 months ago
      You can try the Insert Random Data to create the custom list as red, blue, green, orange and pink, then insert then to range randomly.
  • To post as a guest, your comment is unpublished.
    Steve · 1 years ago
    Why do the values from this function change every time I make an adjustment to the worksheet? I can't test my sample data if the results keep changing
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Sorry, the formula will keep changing while adjusting the sheet because the formula contains RAND() function.
  • To post as a guest, your comment is unpublished.
    Gerald · 1 years ago
    Anyone know how I would go about doing this without replacement using probability pools. Here's an example: Pool A has 10 people. Pool B has 7 People. There is an 80% probability we will pull someone from Pool A; 20% probability we will pull someone from pool B. We want to randomly pick 5 people from the 2 pools without replacement. Even without replacement, the probability of pulling from either pool stays at 80/20. Any Ideas?
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Sorry that I have not found a solustion for your question. If you find a answer, would you mind to let me know?