Random match name to date

  • Thread starter Thread starter JRForm
  • Start date Start date
J

JRForm

I have a list of 208 dates and 27 names. I would like to randomly match a
name to a date without repeating a date assignment. I would also like to
have the names matched to the dates for a total of 7 different dates. Any
ideas would be greatly appreciated.

JRForm
 
Place your dates in column B and your names in column C. In A1 thru A208
enter:
=rand()

Sort columns A & B by A. This will "randomize" or shuffle the dates in
column B.

Now associate B1 thru B27 with C1 thru C27. Each name will have a date
associated with it that is not a repeat of another name's date.

Once this is done, you can then delete cells B1 thru B27 (pulling the
remaining cells in column B upwards). Repeating the association now will
give each name a new date. The new dates are also non-repeating.


Repeat until you have nothing left in column B
 
the code below will get look up randomly in cells A1:A208 a value
=INDIRECT(ADDRESS(INT(208*RAND())+1,1))

If you need 7 dates then repeat the fomula 7 times. the only problem with
this method it is possible to get the same date multiple times. A macro
could be written to make sure you get 7 unique dates.
 
Thank you. This worked quite good.

Gary''s Student said:
Place your dates in column B and your names in column C. In A1 thru A208
enter:
=rand()

Sort columns A & B by A. This will "randomize" or shuffle the dates in
column B.

Now associate B1 thru B27 with C1 thru C27. Each name will have a date
associated with it that is not a repeat of another name's date.

Once this is done, you can then delete cells B1 thru B27 (pulling the
remaining cells in column B upwards). Repeating the association now will
give each name a new date. The new dates are also non-repeating.


Repeat until you have nothing left in column B
 

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

Back
Top