# Generating Random Outcomes Based On Probability

Feb 10, 2009
Can anyone help, I'm trying to create some test data, eg 1000 rows in excel. In each cell a formula (?) returns some text such as Dog, Cat or Rabbit based on the probability Dog=0.5, Cat=0.3, Rabbit=0.2

I've come up with a messy solution of generating a random number between 1-100 and then using a lookup table where 1-50 = dog etc... it works but is long winded and difficult for other people to follow.

View 6 Replies
ADVERTISEMENT
Mar 8, 2007

1. I need to randomly generate either a 1, 6 or 12 every time I hit calculate (i.e. F9).

2. I want to specify the probablility of each result. For example, I want 12 to be the result 80% of the time, and 6 and 1 to be the result 10% of the time.

View 9 Replies
View Related
Aug 14, 2014

Wondering if it is possible to generate a random 4 digit number based off an alphanumeric string?

Example;

Cell A1 has 123XVF1234

Cell A2 has 321AFW4321

In B1 I would like to have a 4-6 digit number that is generated based on the alphanumeric data in Cell A1 (and so on down the list). If that is possible, I would also need to be able to convert back the 4-6 digit number back to its original alphanumeric value

Example;

If B1 returns 643562 it would need to be able to be converted back to 123XVF1234

View 7 Replies
View Related
Nov 21, 2006

im given an area and im asked to generate 10000 random numbers. how can i?

View 2 Replies
View Related
Oct 20, 2009

I have a spreadsheet of 1000+ companies and I want to take a random sampling of 100 of them. I would assume this could be accomplished by auto-filling a numerical value to each line of data (which I did), then scrambling only the column with the numbers (which I can't figure out), and then selecting the entire text and resorting it to put the numbers back in order and then just work with the first 100 rows (which I can do, if I knew how to make the numbers random).

View 10 Replies
View Related
Jul 26, 2013

How to generate semi-random numbers? I have a small sample (26 points) that I would like to extrapolate out and plot on a skewed bell curve. The numbers represent a ratio which can never be less than one. The average of my sample is 1.0149 and the standard deviation is 0.01234. When I use the random number generator tool in the data analysis pack, it generates mostly good numbers, but it also produces numbers like 0.98 and such that are never possible in my data. I've made a plot with the random numbers, including the sub-one ones, and then just adjusted the x-axis so that they wouldn't show on the graph, but I know that that's not the correct way to do it. My graph isn't skewed as much as it should be.

View 1 Replies
View Related
Nov 10, 2008

I wanted to generate 11 random numbers between 1 and 10, which added up to 100 every time I pressed F9...

View 9 Replies
View Related
Feb 19, 2014

I need generating 40 rows (Columns of 17 (Columns A - Q) Random numbers (1 to 5) that will sum to specific values (60, 55..) in R Column, and to regenerate it on pressing any key.

The same has been done for one value in [URL] ..... but I need it for a set.

View 5 Replies
View Related
Oct 14, 2011

I've managed to write a random number generator that produces multiple sets with no repeating numbers per a set.

Now, to step it up a notch, I'm trying to create an even distribution of the numbers generated which is where I could use a hand. Here's my current code:

Code:

Option Base 1

Sub RandomNumberStrings()

Dim rndno As String, strg As String, msg1 As String

Dim r1() As String, r2() As String

[Code]....

Equaling 500 numbers generated as intended, but my target is to get every number with an equal frequency.

View 4 Replies
View Related
Jun 25, 2012

I'm looking to generate correlated random unifrom numbers between 0 and 1 using the excel random number generator, rand(), and a user defined correlation matrix - without the use of a plugin. I realise there are plenty of risk plugins I could use, but was looking for something excel/vba reliant so I could distribute it without the user having to install anything.

I've tried using a cholesky matrix, but most of time it resulted in one of the numbers being 1, and higher that all the others.

View 2 Replies
View Related
Mar 29, 2014

I would like to ask if there's a way to generate a random 4 characters in one cell and the specific random 4 characters that has been generated will be copied until the last cell of my preferred choice?

The format that I want is that:

yymmdd / random 4 characters that has been generated / 4 numbers that will increment sequentially

For example:

in A1: 140330QWER0001

in A2: 140330QWER0002

in A3: 140330QWER0003

.

.

.

.

.

But here's the catch, the file that I am using when closed then opened again will generate another random 4 characters with the same format. If i opened this file tomorrow:

for example the date for tomorrow is March 31, 2014, the file will do:

in A1: 140331TYUI0001

in A2: 140331TYUI0002

in A3: 140331TYUI0003

.

.

.

.

.

I tried to record it, the Rand() function when copied will generate another 4 characters.

View 2 Replies
View Related
Jun 3, 2006

I have two data sets one measured and one modelled and I am testing a conceptual model that proposes that only where the tails of the probability distributions of each data set crosses will you experience an event. I'm enclosing an example file which contains both data sets and some descriptive statistics as well as the associated histograms and a diagram of what I'm ultimately trying to achieve. My question is how I go from the data sets I have with such a large discrepancy between them to plotting their probability distributions?

View 5 Replies
View Related
Dec 24, 2009

I have the following table:

http://img85.imageshack.us/i/tableb.jpg/

Each question is multiple choice (either A/B/C/D/E) and the values listed are the probability of each letter occurring. What formula would I need to put in the 'output' column for it in each row to output a letter based on the probabilities. E.g. in question 1, most of the time it would output E, but sometimes (rarely) A and very rarely B/C/D.

View 9 Replies
View Related
Oct 24, 2013

I need to generate 8 (random) numbers which should range between 0 to 80 and the sum of those generated 8 numbers should be 80.? How can I achieve this.

View 14 Replies
View Related
Aug 5, 2010

I am looking for code that can generate the report that a user selects.

For example the user clicks reports on the userform. The report userform opens up. The user checks the monthly report button and enters the last day of the month he wishes the report to be for. i.e 7/31/2010 and then clicks generate report. when executed excel creates a new workbook and creates two sheets. the first looks exactly like the master data sheet from the original worksheet but of course with the specified data. the second sheet will populate a summary of the data. I will address that after i figure out how to get the first sheet compiled.

View 1 Replies
View Related
Mar 3, 2009

I am trying to create a spreadsheet for an online gift registry. They require that the spreadsheet have the photo's url's in a column. I already have the spreadsheet filled with my data. In the spreadsheet, Column D is filled with unique numbers, some with parenthesis, (ex. 52011, 52011(2), 34132, etc.)

I also have a folder full of images that are similarly formatted as such

"...imagesrand_name_52011.jpg". (They will be moved eventually to a webserver.) Each number in the column may or may not have a corresponding image. And the images may or may not have a corresponding number in the spreadsheet. Is there a way to generate a url automatically in a column that corresponds to the image with the matching number? And if it doesn't, just leave it blank?

View 4 Replies
View Related
Aug 14, 2013

So basically I have a spreadsheet that tracks if a patient has turned in there required paperwork within the last 6 months and then changes the cell to white and lets me know how many days they have left until they are due to turn this paperwork in again. Then if it has expired I have a condition format change the cell to Red but I would like to add in the text EXPIRED to the cell. lastly I have Cells that have no data in them gray and I would like to add in red text saying No Paperwork.

I'm hoping this will be my last build of this spreadsheet so I can go ahead and start applying it to the real workbook [URL]

View 12 Replies
View Related
Feb 13, 2014

I am attempting to find a way to search through a database I created based upon every day of the year. My goal is to have a user input a beginning date and end date for a trip, then my functions will return the range specified with each day and it's individual temperature average (in my database).

I also need generating the dates between the start and end dates that are entered by the user. I was considering combining Days360 with an Hlookup that searches through a massive sheet with all the dates for the upcoming year and then going down 1 in the column for the difference in the dates in each column.

Vlookup Help.xlsx

View 5 Replies
View Related
Sep 11, 2009

I would like to generate a dynamic list of the top five most common text responses in a range. For simplicity sake, let's assume that the range spans cells A1 to A20, and the list is generated in cells B1 to B5. So, essentially, I am seeking five separate formulas. One to calculate the most common text element, one to calculate the second most common text element, one to calculate the third most common text element and so forth.

I am currently working with the two formulas below but finding it incredibly difficult to merge them into a working format.

Formula for finding second most common number:

=MODE(IF(IF(A1:A20"",A1:A20)MODE(IF(A1:A20"",A1:A20)

),IF(A1:A20"",A1:A20),""))

Formula for finding most common text element:

=INDEX(A1:A20,MODE(IF(ISTEXT(A1:A20

),MATCH(A1:A20,A1:A20,0))))

View 9 Replies
View Related
Apr 11, 2007

This is more of a probability question than Excel - but I know Excel has functions to work out the answer (and I was hopeless with probability maths at school so knowing which function to use is also a problem)

Here's the deal:

There are 43,000 tickets in a multiple draw lottery/raffle

There are 1,730 prizes available.

Each winning ticket is returned to the pool after being drawn, so in theory, one extremely lucky ticket holder could take home every prize.

However, what is the statistical probability (chance) of winning a single prize and what formulae/functions does one use to generate the answer?

View 9 Replies
View Related
Nov 27, 2006

There is trading system which generates a winning trade per ONE stock in ONE month’s time with a probability of 5/12 (0,4166%). If the system trades 10 independent stocks the probability of any number of winning trades occurring out of all of them in ONE month is shown below:

None 0,0046

One 0,0326

Two 0,1047

Three 0,1995

Four 0,2494

Five 0,2172

Six 0,1272

Seven 0,0519

Eight 0,0139

Nine 0,0022

Ten 0,0002

I took these values from a book…I tried to reproduce these values in the spreadsheet that I attached. My table looks as follows:

0 0,0046

1 0,0033

2 0,0023

3 0,0017

4 0,0012

5 0,0008

6 0,0006..........

View 2 Replies
View Related
Aug 4, 2014

I have a table of projects with 1) duration in year, 2) time window (number of years of our planning cycle), and 3) start year of the project. I want to generate a list of project parts of all projects where they may take place. This will serve as an input to an optimization program.

So a project of 2-year duration should have 2 parts over any year within the time window. I am including the "impossible" ones for my developer to tag them as "0" when we run it through his code.

View 5 Replies
View Related
May 22, 2014

What I have In Column B, I have the datesIn Column I, I have engineers name What I need I want a macro to generate Serial Nos. (1,2,3....... n) in column A If an only if the date in column B is today's date and the engineer's name matches with the PC's username

The following is my code

[Code] ....

Above code runs without errors but does nothing.

View 4 Replies
View Related
Jun 3, 2014

I want to know if it's possible to calculate the probability that a certain range of values, reach to a certain point.....

The range is this (example):

4

3

9

7

14

22

15

20

42

46.....

What I want to know is if this tendency will reach to 1000. Or how many steps more will be need to reach 1000.

Like I said, and don't know if this is in the right place, but if you put this values in a graphic you will see that the tendency is growing. I assume that this tendency will reach to 1000. But will be in the next 10 steps or in the next 30.

View 3 Replies
View Related
May 5, 2014

=NORM.DIST(-0.7525,0,1,FALSE)=0.30057

I want to do inverse 0.30057 To get -0.7525 ,NORM.INV(0.30057,0,1) This function returns only cumulative distribution .

View 3 Replies
View Related
May 11, 2014

I'm trying to make a bell curve (normal gauss distribution). I have some problems regarding the probability density curve, since its values are so low. If you look column N in the attached file - I used the NORMDIST command. Values should be somewhere between 0,2 and 0,4 - but they're about 100x lower.

View 2 Replies
View Related
Nov 10, 2013

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?

View 5 Replies
View Related
Dec 4, 2006

I need a probability distribution for amounts to be shipped taking into account both the probabilty distribution on parcel sizes (amounts to be shipped) per ship as well as the probabilities on the number of ships arriving.

Please see the following:

Say you have a probabilty distribution for ships arriving, i.e. the probabilty of 1 ship arriving in a specific time period= 0.25 ( event a), the probabilty of 2 ships arriving = 0.2 (event B) etc. Please take into account that this can go up to about 20 ships per time period.

Each ship can have one of four parcel sizes, (demand that needs to be met) (the following are just example probabilties)

0 tons with a probability of 0.67 event 1

1000 tons with a probabilty of 0.08 event 2

1500 tons with a probabilty of 0.222 event 3

2000 tons with a probabilty of 0.022 event 4

Thus event a has a probabilty of occuring, in event a, events 1to 4 can occur with their respective probabilties.

I assumed events 1 to 4 stay the same for all ships arriving (as we are dealing with multiple products, each product will have different parcel size distributions, however I look at products seperately, thus only one product is considered here)

This is simple for 1 or 2 ships, but as the number of ships increase the number of combinations become excessively large.

Should i use a macro that determines permutations/combinations? I am kind of clueless on this one.

If it helps to put the problem in context; I am trying to determine a demand distribution as input for a stochastic programming model

View 7 Replies
View Related
Apr 5, 2009

if h5 = "Supply Only" or "Supply Only With IWA" then I5 should be "S/O" however if h5 = "Supply Only With Survey" or "Supply Only With Survey With IWA" then I5 should be "S/o & S"

h5 could also be "Supply & Fit" or "Supply & Fit With Iwa" which should return "S/F"

but if h5 = "Supply & Fit With Survey" or "Supply & Fit With Survey & IWA" then I5 should be "S/F & S"

View 3 Replies
View Related
Dec 7, 2009

I want to say, if B1 = A then the value is 10, if B1 = B then the value is 20, if C then the value is 30 and D the value is 40.

If there are two conditions then I know it would be =if(b1=A,10,0) but this is obviously a bit more complex.

View 6 Replies
View Related
Apr 20, 2007

Formula that if the cell (C1) looks up C5, and the range in C5 is 1-10000, I want C1 to show 10, or if C5 has less than 1, then I want C5 to show 0.

View 9 Replies
View Related
May 15, 2013

I have been able to put together the below which generates a random 15% sample of all records in the worksheet.

It works perfectly, however what I would ideally like to do is get it to only produce the 15% sample of rows where it is todays date in col B and has the word "other" in col C. I've tried lots of different IF statements and FOR statements, but am only generating blank worksheets.

Sub getrandomrows()

Dim lr As Long, lc As Integer, a As Variant, MyDate As Date

lr = Cells.Find("*", LookIn:=xlValues, after:=[a1], searchorder:=xlByRows, _

[Code].....

View 6 Replies
View Related
Jan 10, 2007

Create a random selection based on odds. It would be similar to the RANDBETWEEN function, but in this case I specifically want one of the three values to be selected randomly in cell C2 based on the odds given.

View 9 Replies
View Related
Jun 24, 2008

I am working on a challenging project. I have a list of names, job titles, and departments. Is it possible to select a random name who matches a specified job title or department? I'd prefer not to sort/filter/delete the original data range because the sheet will be used multiple times during the day by multiple users and with different criteria each time.

View 6 Replies
View Related
Oct 18, 2013

I have an If statement I am trying to get to work but not sure of the flow. Each part works seperately but not together. What I need is if column E is blank leave blank, if cell DI2 is Yes then use columns DJ to DP for the lookup if DI2 is No than use columns O to U for the lookup. The first 2 lines are the individual formulas that work independently. The 3rd was my last attempt at combining them.

=IF($E21="","",VLOOKUP($E21,$O$5:$U$476,2,FALSE))

=IF($DI$2="YES",VLOOKUP($E21,$DJ$5:$DP$366,2,FALSE))

[Code]....

View 2 Replies
View Related
Mar 3, 2014

I have a master worksheet with due dates for various forms to be completed. These forms are on separate worksheets within the workbook.

I'd like to highlight the master date entry in red if the form hasn't been completed by the due date, but also highlight in green when it has been done.

View 1 Replies
View Related
May 2, 2014

I used three different dates. In which the outcomes were available. The first three sheets.

Is there a possiblity to use excel to calculate a future outcome of the next month(Sheet 4). The figures are in a way linear, because the previous months are in it.

So it's possible for the future outcome to go up or stay the same. It can't be less then previous months.

See attachments.

It's about a holiday (combinations) of arrangements. So it'll be influenced by the date (because of holliday plannings), finance etc etc. But the last factors/variables we will use and test in SPSS and other programs.

The question is more: Is there a program/formula in excel which will predict the outcome in the last sheet with maybe a factor of outliners (this coincendence of a better salary in some parts/or the date that people will book a holiday). And how the formula would be formulated in the last sheet?

View 2 Replies
View Related
Feb 9, 2009

I recently posted work of my attempts to create a league table, i feel i have probaly chosen the worst way to record the actual results of matches, causing the need for complicated formula which donkyoite has been very helpful in doing and i thank him, but i dont understand whats going on, was wondering if there was a simplier way?

View 10 Replies
View Related
Sep 28, 2009

I am trying to get more than one outcome from a logical function in a single cell. I am teaching a class and i want this particular cell to add up all the points from tests and quizzes and then give me an outcome of a grade (A,B,C,D, or F) Right now i can only get the cell to give me an outcome of A or B. I need the cell to be able to give me 5 possible outcomes (A,B,C,D,F).

Right now i have this formula in this particular cell......=IF(Q6>234,"A")......so if Q6 is greater than 234pts they get an A...if not they get a B. How can i also give ranges of total points to have the cell give C,D, or F?

View 5 Replies
View Related
Apr 4, 2014

In my sheet i got some negative and positive numbers -210(Negative) and 210(positive).

So when on F there is a Negative number on K must come (Yes).

And when on F there is a positive number on K must come (NO)

It must go on for all on F

Is there function for that in Excel what i got now.

View 5 Replies
View Related