+ Reply to Thread
Results 1 to 11 of 11

Merge Multiple Records

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    4

    Merge Multiple Records

    The attached file shows one student with 3 records. The two records in blue font are for the same class so include all of the same information except for Visit Length (Column L) and the other record is for a different course. I would like to merge the two records that are for the same class and sum the visit length (leave all other variables as is). So once the process is complete, the same student would show two total records only.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,910

    Re: Merge Multiple Records

    What would you want to do about the dates, 4/5/2011 and 4/26/2011?

  3. #3
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    4
    Quote Originally Posted by JeteMc View Post
    What would you want to do about the dates, 4/5/2011 and 4/26/2011?
    I could exclude that column from the final output or delete the column

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Merge Multiple Records

    Do you want to update teh existing table (delete duplicate rows)? or do you want this in a new table (on a new sheet)?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    4
    Quote Originally Posted by FDibbins View Post
    Do you want to update teh existing table (delete duplicate rows)? or do you want this in a new table (on a new sheet)?
    I do not have a preference if the outcome would be the same

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,910

    Re: Merge Multiple Records

    This will find rows in which three main values (Student ID, Reason, Tutor) are matched and sum the time spent with the tutor for those rows. It takes into account your answer to FDibbins' insightful question about a table for output on a separate sheet which omits the Visit Date as per your answer to me. It also makes use of several helper columns, which are automatically generated so that there is no extra input required.

    Tutoring Time.xlsx

    Hope that this is helpful.

  7. #7
    Registered User
    Join Date
    06-08-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    4

    Re: Merge Multiple Records

    Thank you! This is very helpful. I tried to copy my data into your file and noticed that the data is not always getting aggregated if the rows contain the same information. I'm not sure if this is a formatting issue or because there are cases when a student has more than 2 identical records. I will research further to see if I can adjust the formula on my end. Thank you.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,910

    Re: Merge Multiple Records

    You can set up the PivotTable to look almost exactly like the aggregated rows on my output sheet.

    Tutoring Time.xlsx

    As per the amended data, it can handle cases where there are more than two records that apply to the same student, as well as cases where the records are not contiguous.

  9. #9
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,654

    Re: Merge Multiple Records

    Try to solve the problem with a pivot table
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,910

    Re: Merge Multiple Records

    If the student has more than two identical records the formula will not catch the third, etc. Sorry about that, I was going by the example. I'll see if I can make an adjustment, and perhaps some of the high power solvers on here can take a look in the meantime. I do have a question, have you considered using a pivot table?
    I played around with that a little and it seems that would be a lot simpler, if the output meets your needs. (Popipipo beat me to that one)

  11. #11
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,654

    Re: Merge Multiple Records

    Take a look at this pivot table
    Attached Files Attached Files

+ 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. Invoice Mail Merge: Multiple Records per Invoice
    By watfordo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2014, 03:37 PM
  2. Merge Matching Records
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2014, 03:57 PM
  3. [SOLVED] Merge same Records to One Row
    By seenai in forum Excel General
    Replies: 14
    Last Post: 10-29-2012, 07:57 AM
  4. Mail Merge Multiple Records on 1 page
    By NealEHerman in forum Word Formatting & General
    Replies: 5
    Last Post: 08-26-2012, 04:08 AM
  5. Email Merge with variable merge records break by client level
    By sss047 in forum Word Formatting & General
    Replies: 0
    Last Post: 04-15-2011, 04:25 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