Random selection of records based on specifc value
Thanks for your answer. It is not exactly what I meant. I did some
clean up and think that I found a better setup. I have now 2 sheets.
Sheet 'Data" which contains all my data where the values in column [A]
are the record id's (the apples, pears, oranges etc etc).
On sheet "Stats" I have a few formulas that show me:
A The total rows used in Sheets "Data"
B A list of unique values from column [A] of the "Data" sheet.
Can be any number.
C A required sample needed for each item listed in [C]
A B C
200 rows apple 10
pear 20
.... ....
etc etc
The Data sheet looks like this
apple bla bla test test
orange sdjsdjh sdkj
apple dfjkdf dfkjdf
pear jsdkjs lkslksd
.....
etc etc
What I would like is: randomly select (the required number of sampes
[C]) rows from the "Data" sheet for each unique value I have listed in
column [b]. So I need some for each loop I quess that first checks how
many unique items there are and then copy the correct number of
required samples from the "Data" sheet into the "Stats" sheet or a new
sheet.
|