# Group Fields in Mail merge based on common field



## Sinon (Mar 3, 2016)

Hi there! I have a task at work that requires the use of mail merge letters (these are to be printed in the end not sent via email).


Basically, we have a database of companies that are grouped in their own categories (column B -  "Group" in the spreadsheet), each purchasing a product valued at one of two costs. Cost 1 refers to payments before a certain date and Cost 2 refers to later payments. In the letters, we are trying to show the clients (Column C - "Client Name) how much they would have to pay before and after the date (the date is 1st April but is irrelevant here as the prices have already been set in the spreadsheet). Furthermore, if the clients decide to buy multiple products, they get a discounted total price (column E - "Reduced Cost 1" and column G - "Reduced Cost 2"), also based on when they make the payment. In my table, I chose to put the discounted total price for all the lines but I really only need it for a total number.


What I am trying to achieve is to be able to save and print individual letters per group. I've tried adapting some code I found online but I can't make it work. To make it worse, we absolutely have to use a table in word to show all the clients and the prices. this only confuses me further as I could find no code to help with setting up the data in a table in Word the way I need it. i have attached the spreadsheet with some sample data (i have over 90 groups) and also how the document looks before the mail merge and how I would like it to look like in the end.

I've attached the files in question here: https://www.dropbox.com/sh/pg591ijrk8argzs/AABX2l1ipLGorX01oScD6hSza?dl=0


I wouldn't mind having to change the spreadsheet to get it into a better format for the mail merge, it doesn't have to have this current format. My requirements are to get 1 letter per group and keep in the table in Word.
Any help would be greatly appreciated. Thanks


FYI: I've tried the following links:
https://www.youtube.com/watch?v=bld2UWKdTmo
https://www.youtube.com/watch?v=4Ck8KAwAQso
Word: Use Directory Grouping Features in Letter Mail Merge ~ Stacy DuBois' Tech Blog
I've also posted on Excelforum.com


----------



## Macropod (Mar 4, 2016)

Cross-posted at: Group Fields in Mail merge based on common field
Please read our policy on Cross-Posting in rule #13: http://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html


----------



## Sinon (Mar 4, 2016)

My apologies, the link to the other post is here: Group Fields in Mail merge based on common field


----------

