Need to Random Pick Names but exclude certain ones - Please help!

ReginaJ

New Member
Joined
Nov 13, 2008
Messages
1
I have created a list of names on Sheet 1 in column A, but if they have been terminated there is a date in column D. Now I want to schedule random screening of the current names - Need to exlude anyone that has a date listed in column D. (This will be on a second Sheet.) I have figured out how to make it pick one random name by using the following:
=INDEX(DRIVERS!$A:$A,RANDBETWEEN(2,COUNTA(DRIVERS!$A2:$A5000)),1)

How do I make it exclude names in column A if they have a date listed in column D?

Also, I want to make it pick more than one name - Is this possible or do I just have to paste this formula into the number of needed cells?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try...

F2:

=SUMPRODUCT(--(A2:A5000<>""),--(D2:D5000=""))

G2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(ROWS(G$2:G2)<=$F$2,INDEX($A$2:$A$5000,SMALL(IF(ISNA(MATCH($A$2:$A$5000,$G$1:G1,0)),IF($A$2:$A$5000<>"",IF($D$2:$D$5000="",ROW($A$2:$A$5000)-ROW($A$2)+1))),INT(RAND()*($F$2-(ROWS(G$2:G2)-1)))+1)),"")

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top