Mail merge with varying number of records

Anonymous
2022-03-07T09:26:27.193+00:00

Hi

I am a teacher and we are generating report cards where some of the students do more than the required number of subject. Some students do 10 subjects, some do 11 or even 9. The common value is the students name. I have an excel back end with all the information.

How do I create a report card using mail merge when the number of subjects differs for each student. In other words, the mail merge must be dynamic, only showing the subject each student takes.

I have seen videos using grouping by Chris Menard these videos were recorded a long time ago - is there anything more recent in office 365?

Thanks

Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
908 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Paul Edstein 171 Reputation points
    2022-03-07T23:22:40.66+00:00

    You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
    https://www.msofficeforums.com/mail-merge/38721-microsoft-word-catalogue-directory-mailmerge-tutorial.html
    or:
    http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
    The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

    Depending on what you're trying to achieve, the field coding for this can be complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at:
    https://www.msofficeforums.com/mail-merge/9180-mail-merge-duplicate-names-but-different-dollar.html#post23345
    https://www.msofficeforums.com/mail-merge/11436-access-word-creating-list-multiple-records.html#post30327

    Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An outline of this approach can be found at:
    https://answers.microsoft.com/en-us/office/forum/office_2010-word/many-to-one-email-merge-using-tables/8bce1798-fbe8-41f9-a121-1996c14dca5d
    Conversely, if you're using a relational database or, Excel workbook with a separate table with just a single instance of each of the grouping criteria, a DATABASE field in a normal ‘letter’ mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
    https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_winother-mso_2010/mail-merge-to-a-word-table-on-a-single-page/4edb4654-27e0-47d2-bd5f-8642e46fa103
    For some working examples, see:
    https://www.msofficeforums.com/mail-merge/37844-mail-merge-using-one-excel-file-multiple.html
    https://www.msofficeforums.com/mail-merge/45044-using-mailmerge-include-grouped-information-letter-2.html#post151706
    https://www.excelforum.com/excel-general/1273421-merge-excel-list-into-word-receipt.html#post5110813
    (the second of these uses a macro to apply some additional formatting).

    The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: https://www.msofficeforums.com/mail-merge/21847-mail-merge-into-different-coloumns.html#post67097

    Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
    Graham Mayor at https://www.gmayor.com/ManyToOne.htm ; or
    Doug Robbins at https://onedrive.live.com/?cid=5AEDCB43615E886B&id=5AEDCB43615E886B!566

    1 person found this answer helpful.
    0 comments No comments

  2. Charles Kenyon 2,806 Reputation points
    2022-03-07T16:04:35.383+00:00

    This would be a Directory/Catalog merge. Here is a tutorial. http://www.msofficeforums.com/mail-merge/38721-microsoft-word-catalogue-directory-mailmerge-tutorial.html

    Mail Merge has not changed in more than 20 years except for adding the Ribbon user interface so the video is likely accurate.

    You can use IF fields to blank or eliminate lines when a field is blank.
    { IF { MergeField Subject09 } > "" "the text you want on the line here including mergefields" }

    Here is my documentation on the IF Field: http://www.addbalance.com/usersguide/fields.htm#IF_field
    Here is Microsoft's documentation: https://support.microsoft.com/office/9f79e82f-e53b-4ff5-9d2c-ae3b22b7eb5e

    0 comments No comments

  3. Anonymous
    2022-03-19T16:25:12.727+00:00

    Hi

    Im going to look into a Power Automate solution for this. Thank you for the responses and apologies for the delay in my response