+ Reply to Thread
Results 1 to 22 of 22

coverting a list of employees details into team lists on a separate sheet.

  1. #1
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    coverting a list of employees details into team lists on a separate sheet.

    I have a list of employees with their teams and grades etc which I need to replicate automatically on a different sheet, but also in descending grade order.

    my main list contains all the relevant info but I am struggling to create an (array?) formula to copy them across
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Chrisk67,

    PFA and PFB for the updated code. I hope this code will help.

    Please Login or Register  to view this content.
    Regards
    Ramandeep Singh
    Please Click STAR to Add Reputation if my answer helped!
    Attached Files Attached Files

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: coverting a list of employees details into team lists on a separate sheet.

    Put this formula in G4 of Sheet1:

    =A4&"_"&COUNTIF(A$4:A4,A4)

    and copy down to the bottom of your data. This will identify the team and add on a unique sequential number for each team member.

    Then, with the team number in A1 and the headings in row 3, you can use this formula in A4 of Sheet2:

    =IFERROR(INDEX(Sheet1!$A:$F,MATCH($A$1&"_"&ROWS($1:1),Sheet1!$G:$G,0),MATCH(A$3,Sheet1!$A$3:$F$3,0)),"")

    Copy this across and down as required.

    You can put another team name in G1 and use this formula in G4:

    =IFERROR(INDEX(Sheet1!$A:$F,MATCH($G$1&"_"&ROWS($1:1),Sheet1!$G:$G,0),MATCH(G$3,Sheet1!$A$3:$F$3,0)),"")

    (note the slight difference in red), then copy this across and down.

    Hope this helps.

    Pete
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Chrisk67,

    Or you could do it without any VBA or formulas just with 2 Pivot Tables - see attached.

    Regards

    peterrc
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    Thanks for this, could I modify it so all the revised tables would appear on the same page

  6. #6
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    Thanks, it almost produces what I need, but unless I have misread it i dont see anything to sort by grade

  7. #7
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Chrisk67,

    The macro which i shared produce different sheet for each Team and also sort the output by grade. In future, if any new team is included suppose like Team3. The macro i shared is capable of catering the new Team (Team3). Macro will generate separate sheet for Team3 and also sort the result by grade.

    You can check the functionality of the macro by clicking the "Submit" button on the main sheet.

    Regards
    Ramandeep Singh
    Please Click STAR to Add Reputation if my answer helped!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: coverting a list of employees details into team lists on a separate sheet.

    Well, my solution reproduces the tables that you had in the yellow area - in what way(s) do you want it different to that? A strict alphabetic sorting by grade would produce the order HO, O, SO (or the reverse).

    Pete

  9. #9
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    Pete

    I was looking to order by grade down SO-HO-O. I am assuming that as names are added the they would never be in grade order. thanks for your help on this

    Chris

  10. #10
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    thanks for your help on this. I don't think I explained my query. your solution does everything but I was hoping all the output would be on one sheet no matter how many teams. I could then rename it with a date every time there was a change in staffing levels. My full sheet will cover 7 teams and 70 staff so the number of sheets would get out of hand quite quickly with separate tabs for each one. thank you very much for all your help on this.

    Chris

  11. #11
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: coverting a list of employees details into team lists on a separate sheet.

    Quote Originally Posted by chrisk67 View Post
    thanks for your help on this. I don't think I explained my query. your solution does everything but I was hoping all the output would be on one sheet no matter how many teams. I could then rename it with a date every time there was a change in staffing levels. My full sheet will cover 7 teams and 70 staff so the number of sheets would get out of hand quite quickly with separate tabs for each one. thank you very much for all your help on this.

    Chris
    Hi Chirs,

    I have modified the macro as per your requirements. Now, macro display record in the same sheet and sort by grade.

    I hope this code will help. PFA and PFB for the macro.

    Please Login or Register  to view this content.


    Regards
    Ramandeep Singh
    Please Click STAR to Add Reputation if my answer helped!
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    Ramandeep

    thanks for your help on this, it work with one slight glitch. When I add a new team it pushes the formatting for new teams across one column so there are no gaps between the names. Is it straight forward to create all of the teams on a new sheet each time I submit. so that if i ran it today it would put all the teams on sheet 2. If i then added a team and re ran it would put them all on sheet 3. If it is too complicated I can get around by deleting the teams before re submitting

    thnaks again for all your advice

    chris

  13. #13
    Registered User
    Join Date
    09-09-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    65

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Chris,

    PFA and PFB for the modified code as per your requirement. I hope this code will help.

    Please Login or Register  to view this content.
    Regards
    Ramandeep Singh
    Please Click STAR to Add Reputation if my answer helped!
    Attached Files Attached Files

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: coverting a list of employees details into team lists on a separate sheet.

    Another way. It's a bit of a "patch job".

    Try array entering in H6. Then fill down until you get blanks and across. It sorts in the order expected, but only because the source is in descending order. If the source is mixed it will require a different formula.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: coverting a list of employees details into team lists on a separate sheet.

    Please disregard my above post #14. I overlooked your post #9.

    Edit It appears that the Grade sort order is determined by the value in FTE. Do I understand correctly?
    Last edited by FlameRetired; 12-22-2016 at 12:34 PM.

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: coverting a list of employees details into team lists on a separate sheet.

    Working on the understanding that FTE numbers determine the grade sort order I did this.

    This is a bit of a "cheat". In order to descriminate identical FTE numbers and make them unique there is a helper column in column G.
    The formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I don't know how well this will hold up for hundreds (thousands?) of rows, but you can try it.

    Then the formula in H6 array entered and filled across is
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Fill down and across again until you get blanks.

    I swapped an FTE in column F to test it.

  17. #17
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Dave,

    I think a simple MATCH of the grade in column B against those in cells A11:A13 will result in 1, 2, or 3, so these would be a better parameter to use for sorting rather than the FTE. The problem is that I don't know where A11:A13 would be on the real file, as the OP mentions about adding more data (and having 70 lines already).

    Hope this helps.

    Pete

  18. #18
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: coverting a list of employees details into team lists on a separate sheet.

    Quote Originally Posted by Pete_UK View Post
    Hi Dave,

    I think a simple MATCH of the grade in column B against those in cells A11:A13 will result in 1, 2, or 3, so these would be a better parameter to use for sorting rather than the FTE. The problem is that I don't know where A11:A13 would be on the real file, as the OP mentions about adding more data (and having 70 lines already).

    Hope this helps.

    Pete
    Hi Pete,

    Thanks.
    Yes that might help. I've tried fiddling with different MATCH strategies and only ended up confusing myself. Of course I was trying that without helpers.

    Thanks, again. I'll work on it some more.
    Dave

  19. #19
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: coverting a list of employees details into team lists on a separate sheet.

    Edit Disregard. I found some problems with this, too.

    This is similar to my post #16. It uses a helper column and a lookup table to get the proper sort order of Grades with no references to FTE.

    The lookup table is in T:U


    T
    U
    1
    SO
    0
    2
    HO
    1
    3
    O
    2


    The helper formula is in column G.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The final formula array entered in H6 filled down and across again is very similar to my previous. There is only one small change.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 12-22-2016 at 08:52 PM.

  20. #20
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    perfect, thanks for your help

    Chris

  21. #21
    Registered User
    Join Date
    08-16-2016
    Location
    Manchester, England
    MS-Off Ver
    Office 2013
    Posts
    41

    Re: coverting a list of employees details into team lists on a separate sheet.

    tanks for your help. I have managed to get a workable solution with everybody's help.

  22. #22
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: coverting a list of employees details into team lists on a separate sheet.

    Hi Chris,

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] sort list of players by team from player list on separate sheet
    By Biff in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 03:05 PM
  2. [SOLVED] sort list of players by team from player list on separate sheet
    By Biff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM
  3. Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  4. [SOLVED] sort list of players by team from player list on separate sheet
    By Biff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM

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