Random text

J

Juliejg1

I have a list of manufacturers and part numbers. I would like to choose 5
random part numbers for each manufacturer. Is there a way to do this in
excel?
 
F

Frank Kabel

Hi
one way:
- in a helper column enter
=RAND()
and copy this down for all rows
- now sort with this helper column
- use the first 5 entries
 
M

Myrna Larson

Hi, Frank: If he wants part numbers for just one manufacturer, he should sort
by manufacturer 1st and the helper column 2nd, no?
 
D

Debra Dalgleish

In addition to the RAND formula that Frank suggested, you'll need a
formula to count the records for each manufacturer.

Insert a column with the heading "Sample"
In the cell below the heading, enter a formula that refers to the
column that contains the manufacturer name. For example, if the
first manufacturer is in cell D2:
=IF(COUNTIF(D$1:D2,D2)<=5,"X","")
Copy this formula down to the last row of data.

Sort the list by the RAND column
Then, select a cell in the table, and choose Data>Filter>AutoFilter
From the dropdown list in the Sample column, choose "X"
 
F

Frank Kabel

Hi Myrna
agree with you on that. Assumed he had only one manufacturer (which was
probably a wrong assumption :))
 
M

Myrna Larson

Or, as Debra suggests, just use AutoFilter to show only the desired
manufacturer.
 
Top