It turns out that just change the table structure of the data source

During a business trip in other places two days ago, I received a question from student W from the online course "Secrets of Office Efficient Office Mail Merge":

Mr. Gan, hello, may I now send a notice to 32 provinces, autonomous regions and municipalities across the country. Each of them has 2-3 people participating in the 3-4 study classes organized by our unit. The format of the writing Probably: +++ province: please save +++, +++ participate in +++ class, ++++, +++ participate in +++ class, how to achieve mail merge like this?

When I just saw this problem, I was on the way to the airport, and I didn’t see W’s needs carefully. It was simply understood as the result to be output: +++ Save Zhang San, Li Si, Wang Wu to participate in A Course, Course B, Course C, immediately replied to W, and asked him to set the table structure of Excel data as:

Three columns of province, name, and course. After that, enter 2-3 names in the participant column, for example: Zhang San, Li Si, Wang Wu, and enter 3-4 course names in the course column, such as: A course, B course, C course, After that, the letter-type mail merge format can be used to achieve the demand.

If you think about it carefully, you will find that if you do this, you will not be able to map everyone to the corresponding course they have signed up for. Then I thought of the second way of thinking, which is to divide each person's data into different rows and enter it, such as:

Province Name Course

Guangdong Zhang San Gongwen Writing

Guangdong Lisi Gongwen Writing

Guangdong Wang Wu speech skills

Later used in the "Mail Merge Tips for Office Efficient Office" course, there is a section to introduce the function of grouping and merging data using Power Query, and grouping and merging data according to different provinces. But in this case, the table after data aggregation will become the following structure:

Province Name Course

Guangdong Zhang San, Li Si Gongwen writing

Guangdong Wang Wu speech skills

After sending this reply to W, I boarded the plane. During the flight, I suddenly thought of the table structure just now. There will be multiple rows of data in the same province, so I need to use one-to-many mail merge to operate. One-to-many mail merge can only write the data of different people in the same province in different rows or columns, not in the same row. Is there an easier way to achieve this requirement? The original intention of developing this course is to achieve the production and generation of batch documents in a simple and efficient way.

I thought about it for a while and didn't have a better idea, and then I just put this problem aside and took a good rest on the plane. When I got off the plane, I suddenly had the inspiration of what we often say "Aha". I found that the solution is so simple, I only need to change the table structure to easily achieve W requirements.

image.png

Guess you like

Origin blog.51cto.com/15061401/2588752