Experts:
I need some assistance with creating an Excel formula which will generate string values based on both "lookup" values and their associated probabilities. See details below (as well as attached XLS).
Background:
- I have 3 look-up areas covering demographics "Race" (A2:A8); "Gender" (D2:D4), and "State" (G2:G6).
- The lists are merely for *demo* purposes. Naturally, the list (e.g., "State") may grow to include all 50 states (vs. just listing 5 US States).
- Next to each value, I have some completely *arbitrary* probabilities. The sum of each probabilities (column B, E, and H) adds up to be 100%. Again, these % are purely for demo purposes.
What I Want to Achieve (via e.g., Excel formula):
- I have a matrix with 30 blank records (K2:M31).
- Now, I want to generate some random data for each of the 3 columns (K:M); however, I want the number of random values to be generated based on their individual probabilities.
Example:
- In cell range M2:M31 (State), I want to generate values where "CA" will approximately occur 12 times (30 records * 40%). Now, if it turns out that "CA" would exist 11 or 13 times, that will be perfectly fine.
- Overall though, once the matrix has been populated with 30 randomly generated values, the overall distribution of the values should somewhat be representative of the indivudal probabilties.
My Question:
- Is there a way I can use some RANDOM formula that populates the matrix accordingly?
- Please keep in mind that my lookup values (columns A, D, G) could increase or decrease.
- Also, for demo purposes, my matrix is only 30 rows deep. However, I need to be able to adjust any formulas so that I could generate a matrix with, e.g., 1000 records. Is that possible? If yes, how?
Thank you in advance,
EEH
Bookmarks