+ Reply to Thread
Results 1 to 16 of 16

How can I randomly generate a list of names for a whole year

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    How can I randomly generate a list of names for a whole year

    I need to create a log which include about 8-10 names and just randomly generate each name to a date for a whole year. In other words I want to divide 8-10 names into a year. (The year part is not that important as I may start off on a different month and not January, Just want to generate random names)

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: How can I randomly generate a list of names for a whole year

    Assign each name a number 1 through 10. Create a list of dates. In an adjacent cell type =Randbetween(1,10). Copy this formula down. You can match the numbers to the names using Vlookup.

    Here is information on randbetween
    http://office.microsoft.com/en-us/ex...005209230.aspx
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: How can I randomly generate a list of names for a whole year

    See the attached workbook. The full list is in A1 thru A10. The random picks are below.
    Attached Files Attached Files
    Gary's Student

  4. #4
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by Jakobshavn View Post
    See the attached workbook. The full list is in A1 thru A10. The random picks are below.
    Perfect! Thanks you're awesome.

  5. #5
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Also, is it possible to to generate a date starting 1/1/2012 to 11/1/12 and randomly generate to the last ending date starting on A5 (1/1/12) and ending at A198 (11-1-12) I need it to be between those cells.

    Example:

    A5:1/1/12
    A6:1/5/12
    A197:10/25/12
    A198:11/1/12

    the random date has to be in continuance order It has to be in order. hope It doesn;t sound confusing. (So between A5 and A198 I need the date to randomly ascend the date to end at 11-1-12).

    Thanks in advance for any help.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I randomly generate a list of names for a whole year

    A little tricky because if each cell is totally random, then you might not have enough dates between present cell and date and final cell and date.

    Here's a possibility
    In E5 dragged down 1/1/2012 through 11/1/2012 (All of this can be hidden afterwards or placed on a different sheet)
    In D5 dragged down just as far, =RAND()
    Copy and paste special >values to make the random numbers constant. Then sort on the random numbers

    In A5 dragged down
    =SMALL($E$5:$E$198, ROW(A1))
    If you want it to begin and end with 1/1 and 11/1, just fill in A5 and A198 manually.
    Does that work for you?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by ChemistB View Post
    A little tricky because if each cell is totally random, then you might not have enough dates between present cell and date and final cell and date.

    Here's a possibility
    In E5 dragged down 1/1/2012 through 11/1/2012 (All of this can be hidden afterwards or placed on a different sheet)
    In D5 dragged down just as far, =RAND()
    Copy and paste special >values to make the random numbers constant. Then sort on the random numbers

    In A5 dragged down
    =SMALL($E$5:$E$198, ROW(A1))
    If you want it to begin and end with 1/1 and 11/1, just fill in A5 and A198 manually.
    Does that work for you?
    where do I copy and paste to?

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I randomly generate a list of names for a whole year

    Copy and paste special >Values on top of the original cells containing formulas (i.e. RAND()) to remove the formulas and keep the values.

  9. #9
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by ChemistB View Post
    Copy and paste special >Values on top of the original cells containing formulas (i.e. RAND()) to remove the formulas and keep the values.
    Its not working

  10. #10
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    This is my result

    DATES.jpg

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I randomly generate a list of names for a whole year

    You need to format the cells in Col A as dates

  12. #12
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by ChemistB View Post
    You need to format the cells in Col A as dates
    Got it, how how do I sort the random numbers? Sorry I'm not to familiar with excel

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I randomly generate a list of names for a whole year

    Select D5, CNTRL + SHFT + 8 will select the entire range. Then from the Home Tab> Sort and Filter> Sort Smallest to Largest
    Did that work?

  14. #14
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by ChemistB View Post
    Select D5, CNTRL + SHFT + 8 will select the entire range. Then from the Home Tab> Sort and Filter> Sort Smallest to Largest
    Did that work?
    I give up

    I can't get the dates on E to change like it shows on your file it stays the same

  15. #15
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I randomly generate a list of names for a whole year

    Try it this way instead
    Select D5
    CNTRL + SHFT + 8 (should see both D and E selected)
    Home Tab> Sort and Filter > Custom Sort
    "Sort by:" Column D
    Smallest to Largest
    "OK"

  16. #16
    Registered User
    Join Date
    11-14-2012
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How can I randomly generate a list of names for a whole year

    Quote Originally Posted by ChemistB View Post
    Try it this way instead
    Select D5
    CNTRL + SHFT + 8 (should see both D and E selected)
    Home Tab> Sort and Filter > Custom Sort
    "Sort by:" Column D
    Smallest to Largest
    "OK"
    It worked!! Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1