+ Reply to Thread
Results 1 to 15 of 15

How would I group a list of inputted names into groups of five ?

  1. #1
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    How would I group a list of inputted names into groups of five ?

    I'm going to be coaching kids hockey team and I would like to insure fair play for all. I would like to create a shift by shift print out for each game. I would input a list of players attending and I would like them automatically grouped into five by just going down the list of names in order and repeating when getting to end of list. Amount of players would vary but never more then 15.



    Input this:

    Players:

    Jim
    Tony
    Fred
    Bobby
    Tyler
    Seth
    Bill
    Carl

    and end up with something like this:

    Jim
    Tony
    Fred
    Bobby
    Tyler

    Seth
    Bill
    Carl
    Jim
    Tony

    Fred
    Bobby
    Tyler
    Seth
    Bill etc................


    Simple but I'm a newbie so please help me!!!!!


    Cheers!


    Anthony
    Last edited by palotz; 08-29-2012 at 10:59 PM.

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Very simple need help!

    Anthony, your headline does not fit the forum rules. very simple does not tell us what your problem is. You will probably need to change the name of your post to something more descriptive.

    On another note, how many groups of five people would you like?
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Very simple need help!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Ben Van Johnson

  4. #4
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: Very simple need help!

    here is the code that i believe that you will need.

    Please Login or Register  to view this content.
    If A1 is the heading players and column A is all of your players listed. Then C1 is the heading Group. this will look in column a and separate your players into groups of 5. To put this in as a module press alt+F11 and insert a module and copy this code in there, then just run. Let me know if this is what you are looking for

  5. #5
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Very simple need help!

    Thanks amotto, there will be 15 groups of five.

  6. #6
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How would I group a list of inputted names into groups of five ?

    what if I wanted 3 groups of five in column C, 3 in column F, 3 in column I, 3 in column L, and 3 in column O. and give each group a title "Shift 1" "Shift 2" " Shift 3" "Shift 4" etc.......

  7. #7
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: How would I group a list of inputted names into groups of five ?

    This is what you will want then

    Please Login or Register  to view this content.
    Still Put Players as a header in A1 and list your players in Column A after that. then as a Header in C, F, I, L, O... put Group 1, Group 2... or whatever header you would like. If you run this code it should give you what you want.

  8. #8
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How would I group a list of inputted names into groups of five ?

    Once again thanks amotto,

    How would I be able to keep 15 groups in these 5 columns ?

    C F I L O
    5 5 5 5 5 <<<< group 6 starts back at C
    5 5 5 5 5 <<<<< group 11 starts back at C
    5 5 5 5 5

    Hope I explained it clearly above.

    Cheers!

    Anthony

  9. #9
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: How would I group a list of inputted names into groups of five ?

    would you like a blank row in between group 1 and 6 in column C?

  10. #10
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How would I group a list of inputted names into groups of five ?

    Yes, maybe 2. Also between 6 and 11.

    ---------- Post added at 09:24 AM ---------- Previous post was at 09:21 AM ----------

    Thanks for being understanding of my lack of knowledge in excel. I'm slowly working through each line of the code and trying to understand what they do.

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How would I group a list of inputted names into groups of five ?

    This little macro assumes all the names are in column A starting at A1, and the rest of the sheet is blank. It will randomly create groups of members based on the answer to the popup that occurs at the beginning, the default is 5 so you can just press ENTER.

    The groups will be created in rows starting at D1.

    Please Login or Register  to view this content.


    Each time you run the macro you will get a completely different set of names.
    Last edited by JBeaucaire; 08-30-2012 at 09:32 AM. Reason: Added part in red
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  12. #12
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: How would I group a list of inputted names into groups of five ?

    This should be what you want. Let me know

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How would I group a list of inputted names into groups of five ?

    Exactly what I wanted!!! What would I change to add another row in between each five groups ?

    Cheers!

    Anthony

  14. #14
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: How would I group a list of inputted names into groups of five ?

    where i have gr*7 you could do gr*8 or so on and so forth

    ---------- Post added at 08:50 AM ---------- Previous post was at 08:50 AM ----------

    Don't forget to mark the thread as solved, if that is what you are looking for, the instructions are in my signature.

  15. #15
    Registered User
    Join Date
    08-29-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How would I group a list of inputted names into groups of five ?

    Excellent!

    Big help amotto.

    Anthony

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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