[Originally posted June 2012. Updated August 2018.]
Start the mail merge process by clicking the 'Start Mail Merge' button in the ribbon, and selecting a template type. Open the Mail Merge document and click the Mailings tab at the top of the window. Be sure the Preview Results button is toggled off so that you can see the Mail-Merge fields. Then right-click a Mail-Merge field (such as «Donation») and choose the Toggle Field Code option.
The Mail Merge feature of Microsoft Word is one of my favorite parts of the program. It is extremely powerful for creating labels and customized letters, emails, or reports. Once you learn how to use it, you can save countless hours of work. Unfortunately, the task of learning to master all of its idiosyncrasies can give you countless headaches.
One of the perennial annoyances of Mail Merge is its inability to format numbers from an Excel spreadsheet correctly. For example, a sales result in Excel appears as 100 but in Word it suddenly becomes 99.99999999996!
Fortunately, there is a way to fix this. In fact, there are three ways. We can modify the spreadsheet, modify the Mail-Merge document, or simply modify the way the two files connect to each other. Although this last approach is little known, it might be best approach—except for one giant detail: It no longer works for Word 2016.
[Note for users of various versions of Microsoft Office: The steps presented here are for Office 2016 as of August 2018, but the steps needed for older and newer versions of Word and Excel are very similar if not identical.]
The first way is to avoid the problem: In the Excel worksheet, insert a column with a formula that converts the Excel numbers or dates into a text format that is exactly the same as what you would want to appear in your Mail Merge document.
To do this, you need to use Excel’s TEXT function, which enables you to convert a number or date into its equivalent text formatted exactly the way you desire. The downside is that you need to know certain formatting codes. Although these codes are identical to those used in the Custom Number formatting feature of Excel, they are rarely seen by most Excel users.
For example, the formulas TEXT(B3, “$#,##0.00”) and TEXT(C5, “M/dd/yy”) convert number and date data into textual data (in this case, “$12,345.67” and “12/01/10”).
(Tip: It is a good idea to format the cells containing these formulas in a different style, say, italic, or some unusual color to remind you that these numbers are simply text. In older versions of Excel, these “numbers” could not be used in calculations. In Excel 2016, they can be used in all formulas except aggregate functions, such as, SUM and AVERAGE.)
The advantage of formatting numbers and dates as text is that text is transported from Excel into a Word Mail Merge document unmolested. Well, almost unmolested. Formatting options such as font, size, and color do not make the trip.
Format Codes for Excel’s TEXT Function
A collection of the most commonly used codes is presented at the right. A key thing to remember is that both “0” and “#” act as placeholders for digits, but “0” will force leading or trailing zeros to appear. The “#” placeholder will be replaced by a digit only if it is not a leading or trailing zero. Thus, the code “00000” will ensure that the leading zero is not truncated from New Jersey postal zip codes.
These codes for numbers, dates, and times can be used in the TEXT function or in Excel’s Custom number formats. As an extra bonus, they can also be used in the “Numeric Switches” in Word Mail-Merge Fields described in the next section.
Unfortunately, there is a slight difference between the way these codes work in Excel and Word in Microsoft Office 2013. In Excel, you can use either “M” or “m” for months or minutes. In almost all cases, Excel is smart enough to figure out which units you are talking about. But Word is not so smart, and you must use the capitalized letter to refer to months. Also, Excel has an additional code, “MMMMM”, which returns a single letter abbreviation for the month (e.g., “J, F, M, A, …”).
Supplementing a spreadsheet table with a few columns featuring TEXT functions is a simple and direct approach. Just remember that these cells may look like they contain numbers, but they cannot be used in SUM or AVERAGE functions. If you need to convert them into numbers again, just use the VALUE function.
Handle with Care: The ROUND Function
Instead of the TEXT() function, some users prefer to use the ROUND() function to trim off extra decimal places. As its name implies, Excel’s ROUND() function will permanently round a number up or down to the number of decimal places you specify. The advantage is that the rounded number is not text and can still be used for further calculations. In many cases, the ROUND() function will work well with Mail Merge, but you may want to steer clear of it because of the following reasons:
- The ROUND function will not preserve the dollar sign or the thousands separator (comma)
- The ROUND function will truncate trailing zeros
- The ROUND function sometimes causes Mail Merge to display the wrong number of decimal places. For example, a Mail Merge document occasionally shows 4 decimal places when the ROUND function had specified 2 or 3.
In rare cases, the ROUND function causes Mail Merge to show a slightly different number. For example, instead of displaying 1.0014, Mail Merge showed 1.0013.
Okay. But let’s say that you can’t or don’t want to change your Excel spreadsheet. Well, there is something we can do in Word:
The second way to cajole Mail Merge into displaying numbers from Excel correctly is to modify the Word document. Specifically, this means applying the desired number format code to the Merge Fields in the Word document. (The merge fields basically tell the Word document which column in the Excel table has the desired data.) To apply a format to a field, you must include a numeric switch (formerly called a picture switch) in the field’s field code.
The first thing you have to do is to see the actual field code. Open the Mail Merge document and click the Mailings tab at the top of the window. Be sure the Preview Results button is toggled off so that you can see the Mail-Merge fields. Then right-click a Mail-Merge field (such as «Donation») and choose the Toggle Field Code option. You should now see the actual field code for that field, which is designated by curly braces as in { MERGEFIELD Donation }. Now edit the field code by simply inserting a numeric switch code to the end of the field code, as in
There are many picture codes available. Here are four examples with their respective results:
As you can see, the numeric switch codes are identical to the Excel formatting codes except that they are preceded by “#” for numbers and “@” for dates. (Note the use of quotation marks in the date code but not in the number codes.) To see more of the codes available, refer to the table below, or see the online help for “numeric switch” in Microsoft Word.
Here are some examples of how the numeric field codes work with data in a column labeled “Sales” in an Excel spreadsheet.
Numeric Switches for Mail-Merge MergeFields
In light of the fact that Word and Excel use the same formatting codes, we could not help wondering why they don’t use the same function format. For example, why not have the MergeField function look something like:
Good question. You’ll have to ask Microsoft.
Note: Before you start cursing me out, try to remember that when you add or change a numeric switch, the effect may not be shown immediately. You either have to update the field (right-click it and choose Update Field), or click the button Mailings > Preview Results. On one occasion I had to do this 2 or 3 times. If you are using the Mail-Merge Wizard, you may have to go back a step and return to see the effect of your changes. (Why? Again, you will have to ask Microsoft.)
The numeric switches in merge fields work well, but I find the process very difficult to remember. (“Is it a forward slash or a back slash?”) Also, it is very easy to make a mistake. Fortunately, for some users there is another way:
The above approaches are relatively simple, but if you have more than a few fields that require formatting, they can drive you into early retirement. At the very least, they require you to remember format codes that, while similar, are used in very different ways.
A much more elegant and simple solution is to have Word link to the Excel workbook via a DDE (Dynamic Data Exchange) link rather than the usual, presumably non-dynamic, linking process. That sounds a little daunting, but if you are smart enough to do Mail Merge, then DDE can a piece of cake. It is a simple two-step process, and the first step — enabling Word to open a file via DDE — has to be done only once.
[Does DDE work in Office 2016?Dynamic Data Exchange is an old technology, and it looks like Microsoft is in the process of pulling the plug on it. Sometimes it works for me in Office 2016, and sometimes it doesn’t.
The trick appears to be that the Excel data source must be open before you access it from Word. As usual for Excel data sources, the table must begin on the first row of the first worksheet in the workbook file. If you do this, and have some patience, you should be able to get it to work.]
To set up Word 2013 for DDE links, do the following:
- Click: File > Options.
- Click the Advanced tab on the left and scroll down to the section General.
- Check the box labeled Confirm file format conversion on open.
That’s all for the first step, and you never have to do it again. From now on, your copy of Word can open up many different types of files, and can open these by different avenues, including DDE. The only side effect of the above is that every time you open a non-Word file with Word, the program will give you a chance to change your mind. No problem.
The second and last step has to be done each time you select a data source for your Mail Merge operation (either in Step 3 of Word’s Mail Merge Wizard or after you press the Select Recipients button in the Mailings ribbon). Relax. It is just three additional mouse clicks:
- After you have chosen the data file you would like to use, a new “Confirm Data Source” dialog box will appear.
- The default type of link is by OLE, but that is not what you want.
- In the Confirm Data Source dialog box, click the check box to Show all.
- In the expanded list of file types, choose MS Excel Worksheets via DDE (*.xls). (Choose this even if you are using the newer Excel file format: *.xlsx.)
- If asked, confirm that you are selecting the Entire Spreadsheet.
If you have already selected a spreadsheet for your Word document, you may have to select it again, this time via a DDE link. That’s it! From now on, your Excel formatting will travel over to Word Mail Merge documents fairly intact. One huge caveat here: Make sure that the data you want to merge are in the first sheet of your Excel workbook. (It took us two hours to finally figure out that DDE does not see anything but the first Excel worksheet!)
It is a shame that Microsoft has not replaced DDE with a new technology that works in a similar manner. When DDE worked, it was marvelous. Let’s hope an equally marvelous technology will appear in the near future.
Does DDE work for you in Word 2016? If you have a comment about that or any other issue related to Mail Merge number formatting, please let me know. Click here to post an anonymous comment.
Ah, the dreaded mail merge. OK, so maybe this one is not so much of a secret as some of the other tips and tricks in this series, but you have to admit there’s something mysterious about this tool. If you even know what mail merge is, you’re probably not sure if it’s an Outlook, Excel or Word function.
The truth is, a mail merge can encompass all of the above or just Microsoft Word. Outlook and Excel can provide your contact database or list data, and Word is where it all comes together.
You can use mail merge whenever you want to create a set of documents that are essentially the same but each contains unique elements. Whether you’re tasked with sending holiday cards or distributing 200 promotional letters announcing a new service or product, learning how to use the mail merge function can save you time (and frustration).
Using mail merge, you can create:
- A letter that announces a new product. Your company logo and the text about the product will appear in each letter, but the address and greeting line will be different in each letter.
- A set of labels or envelopes. The return address is the same on all the labels or envelopes, but the destination address is unique on each one.
- A set of form letters, e-mail messages or faxes. The basic content is the same in all the letters, messages or faxes, but each contains information that is specific to the individual recipient, such as name, address, and job title.
You don’t want to create each letter, label or message individually, typing each name and address one at a time, do you? Of course not; that would take hours. Lucky for you, Word’s mail merge wizard makes the task fairly easy. Using mail merge, all you have to do is create one document that contains the information that is the same in each version. Then you just add some placeholders for the information that is unique to each version. Word takes care of the rest.
Key things to keep in mind before doing a mail merge:
- Use templates or the wizard. You can use one of Word’s mail merge templates. If you start with a template, you can use the fields that are already in place when you merge your data. If you start from scratch, you can use the mail merge wizard to guide you through the process, step by step.
- Begin with the end in mind. My boss reminds me of this Stephen Covey phrase whenever she sees my puzzled look indicating “I don’t know where to start.” Word gives you a range of choices for the type of merge document you want to create. Go to the “Mailings” tab and then click “Start Mail Merge” to see your choices. The first choice, “Letters,” is the most common, but you can also create labels, envelopes, email messages, and even a directory you can use for an employee roster, a product listing, a course catalog, or something else that fits your needs.
- Know your data. Before you begin the mail merge process, look at the data and get an idea of the fields (e.g., First Name, Last Name, Product) you’re likely to use in the merge process. This will help you later when you create your letter.
How to do a mail merge (instructions for Microsoft Word 2007 & 2010):
- Step 1: Click on the “Mailings” tab at the top of the page.
- Step 2: Click on the “Start Mail Merge” option and then select “Step by Step Mail Merge Wizard…”.
- Step 3: Select the document type you want to complete the mail merge for (e.g., letters, email messages, envelopes, labels).
- Step 4: Click on “Next: Starting document” in the bottom right corner of your screen. Select to use your current document, another document or to start a new template.
- Step 5: Click on the “Next: Select recipients.” Choose to use an existing list, select from Outlook contacts, or enter a new list (whichwill prompt you to type a new address list into various fields).
- Step 6: Then select “Next: Write your letter.” Type the message and add placeholders for the information that is unique to each version.
- Step 7: Click “Next: Preview your letters” to see your letters and edit your recipient list.
- Step 8: Click on the “Next: Complete the merge”. Now you can print or edit individual letters.
- Step 9: After you’re done making changes, go to the top menu bar, and select “Finish and Merge,” where you can choose to print the documents or send a mass email.
The mail merge process has traditionally been viewed as daunting and complicated. But once you master a few basics, you’ll discover that Word’s mail merge tools are straightforward and easy to use … with the help of a friendly wizard.
You Might Also Like
Insurance in the COVID Era: Plan to Protect Your Business
No Mail Merge Wizard In Word Format
Read MoreMicrosoft Office Mail Merge Wizard
Tags: Kaufman Rossin University, Microsoft Office, Software