Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Canada
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting a random name (2003)

    Is there a way to select a random name from a list?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Selecting a random name (2003)

    if your list is in A1:A100
    =index(a1:A100,INT(RAND()*100)+1)
    will give a random name from the list

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Canada
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a random name (2003)

    Perfect! Thanks [img]/forums/images/smilies/smile.gif[/img]

  4. #4
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a random name (2003)

    Is there a method in Excel to prevent the same name from being selected a second time?

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a random name (2003)

    Not with a formula, but you can do it with VBA code. The code in the workbook in <!post=This Post,54084>This Post<!/post> creates a random list of names for a mailing from a longer list with no repeats. It could be modified to do what you want. The code in <!post=This Post,390504>This Post<!/post> creates a list of random integers with no repeats that could be used as indexes to select from your list.
    Legare Coleman

  6. #6
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Selecting a random name (2003)

    Chona

    I did a very simple piece of code for a colleague who wanted to do monthly prize draw.

    I hope this helps
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •