Avatar of Iretioluwa Olawuyi
Iretioluwa Olawuyi
Flag for Nigeria asked on

Extracting multiple records from a Data set

I have a data I want to analyze by extracting at random, 4% of the unique record in column 1 and is either Gold or Silver as indicated in the second column.

I will be glad to have your assistance.

Data Source
Microsoft OfficeMicrosoft AccessMicrosoft ExcelVBASQL

Avatar of undefined
Last Comment
Iretioluwa Olawuyi

8/22/2022 - Mon
Saqib Husain

Can you explain/specify in what form is the output desired?
Iretioluwa Olawuyi

ASKER
Thank you for your response sir,

The table below is a summary of the other file I shared, I wanted to extract a list from the record such that for each item on the first column as shown below, I have an extraction equal to the no of rows as indicated in the column with the 4% header. I could use a filter and go through one by one, but I believe there's a better way to go about it.

PS Territory      No       4%
94C5A1AA      281      12
94C5A1AB      344      14
94C5A1AC      224      9
94C5A1AD      211      9
94C5A1AE      315      13
94C5B2AA      281      12
94C5B2AB      411      17
94C5B2AC      341      14
.
.
.
Grand Total      79904
Saqib Husain

Take a look at this file
Data-Extract.xlsx
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Iretioluwa Olawuyi

ASKER
Many thanks for the attempt sir, I appreciate it.
However, what you did is the summary and what I really need is the data just like this extract I did manually...

94C5A1AA      Silver
94C5A1AA      Gold
94C5A1AA      Silver
94C5A1AA      Gold
94C5A1AA      Silver
94C5A1AA      Gold
94C5A1AA      Silver
94C5A1AA      Gold
94C5A1AA      Silver
94C5A1AA      Silver
94C5A1AA      Silver
94C5A1AA      Gold
94C5A1AB      Gold
94C5A1AB      Silver
94C5A1AB      Silver
94C5A1AB      Gold
94C5A1AB      Silver
94C5A1AB      Gold
94C5A1AB      Gold
94C5A1AB      Silver
94C5A1AB      Silver
94C5A1AB      Gold
94C5A1AB      Silver
94C5A1AB      Silver
94C5A1AB      Gold
94C5A1AB      Silver

This is what you did sir

94C5A1AA      281      12
94C5A1AB      344      14

I can't seem to continue manually, else I'll spend the whole day on it.
If you've worked with queries on MS Access, I can exploit that as well, but I haven't gotten a query that gives me what I wanted.
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Iretioluwa Olawuyi

ASKER
I will like to thank you very much for your support on this challenge Sir,
I know I can't thank you enough but I pray that God will bless you. Amen.
I was able to read through the vba code and will go ahead to use it and append the remaining variables to column G.
Many Thanks!!!