+ Reply to Thread
Results 1 to 13 of 13

Transpose AND compile data for unique identifiers

  1. #1
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Transpose AND compile data for unique identifiers

    Hello all,

    I have a sheet with employee attendance (in hours attended per session) at professional development. Each row in the sheet represents one employee-session. The key columns are as follows from L-R:

    Employee ID, Provider, Date

    Note that if an employee has attended multiple sessions, each is represented in its own row.

    What I would like to do is have each row represent an employee, and have an individual column for each session. This way, if an employee has attended multiple sessions, I have their hours of attendance all in the same row.

    So far, I have figured out how to transpose each unique session into its own column header, and I have entered a VLOOKUP function to get the hours of attendance for each session in its respective new column. But these are still spread out over separate rows for each employee. Again, I want to essentially collapse these rows into one row per employee.

    Let me know if I'm not being clear enough.

    Thanks in advance!

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    Can you post an example of the data? Provide a before (raw data) and after example (what you want it to look like).

  3. #3
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Before/After

    Okay, one sheet shows what I've got ("Before"), the next shows what I want it to look like ("After"). Thanks.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17
    Obviously, I want the hours for each session attended by the employee pasted beneath each session date. (And names/numbers/school have been changed.)

  5. #5
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    In Cell E4 on the after sheet, paste the following and then copy down and across:
    Please Login or Register  to view this content.
    Important to remember:
    The information coming from the "Before" data area must have the same dimension - that is the column sizes need to be the same. In this example they all went from rows 2 to 21.

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

    I did not check on School, First and last names as I assumed each Student ID would be unique. So I had 4 arguments, Class, Date, Student ID, and Hours. Here's your example with the rows filled in.

    ChemistB
    Attached Files Attached Files
    Last edited by ChemistB; 09-04-2008 at 12:31 PM. Reason: Modified text and file as per discussion with mdbct

  7. #7
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    ChemistB,
    What version are you using? I'm using 2003 - I'm guessing you are using 2007 (????).

    I didn't even notice that there was a unique student ID. I was too concerned with getting the formula posted.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    I'm using 2000. I'm guessing that from 2003 upward, Excel is "smart" enough to recognize the difference. I tried by just putting the first argument in quotes with -- but ended up having to set up each T/F argument that way. Our company is supposedly going to 2007 next year (probably just in time for it to be obsoleted.)

  9. #9
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    That's odd. I just migrated from 2000 and didn't need to use the double dash.

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    I had thought that as long as 1 of the arguments was a true number, I wouldn't either but I got 0's for all my results without them (--).

    Testing.......
    Okay, I need to put each True/False argument within parenthesis but don't need the --. I'll update my post.

    Thanks

    ChemistB

  11. #11
    Registered User
    Join Date
    07-07-2008
    Location
    Chicago
    Posts
    17

    Thanks

    Works great. Many thanks.

  12. #12
    Registered User
    Join Date
    05-17-2012
    Location
    dubai
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Transpose AND compile data for unique identifiers

    Hello,

    This is a good solution for a couple criteria, but what if you have 200 or more different types of training/classes employees attend? Is there a more effective solution?

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Transpose AND compile data for unique identifiers

    mgao77,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have 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)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Looping through worksheets in a workbook to pull data
    By fecurtis in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2008, 01:40 PM

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