How can I choose every nth name in a spreadsheet?

G

Guest

I need to take a random sample of names from a spreadsheet. I would like to
choose every Nth name in the sheet. Does anyone know how to do that?
 
B

Bob Phillips

Add a helper column with a formula of

=ROW()=INT(ROW()/n)*n

and copy down.

Filter on the TRUE values

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Don Guillett

try
Sub selectnrows()
'n = 3
'or
n = InputBox("how many")
Rows.Hidden = False
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row Step n
Cells(i, "a").Resize(n - 1, 1).EntireRow.Hidden = True
'MsgBox i
Next i
End Sub
 
B

Bob I

Use a helper cell, number from 1 to N down the rows, select the 1 to N
cells, and copy, then Paste in starting at the first blank cell after N,
now sort on that column and then pick a group randomly, any number 1
through N.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top