As you can see, the numeric switch code is the same as Excel format code except they are followed by the "#" for the number and "@" for the date.
Note : Only use quotation marks in date code, do not use for codes.
To see more codes, see the table below or search for numeric switch codes in Microsoft Word online.
Here are some examples of numeric field codes for data in the ' Sales ' column in Excel spreadsheets.
Numeric switch for Mail-Merge merge field
In fact, Word and Excel use the same format code, but do not use the same function format. For example, there is no MergeField function like the one below:
{MERGEFIELD (Donation, "$ #, ## 0.00")}
Note : When adding or changing the numeric switch, the effect may not change immediately, you need to update the field by clicking on it and selecting Update Field or clicking the Mailings button > Preview Results . Sometimes you have to do this 2 or 3 times. If you use the Mail-Merge Wizard, you may have to go back to the previous steps to see the changes.
In an Excel spreadsheet, insert a column using the formula to convert the number or date in Excel to the text format you want to appear in Mail Merge.
To do this, we will use the TEXT function in Excel. This function has the function of converting numbers or dates into the corresponding text format. However, this method has a disadvantage that you need to know certain format codes. Although these codes are identical to the code used in Excel's Custom Number formatting feature, most users rarely see them.
For example : The formulas TEXT (B3, '$ #, ## 0.00') and TEXT (C5, 'M / dd / yy') convert numbers and dates into text (in this case the conversion will become '$ 12,345.67' and '12 / 01/10 '.
Tip : You should format the box containing these formulas in another form (italic, bold, other colors) to know these numbers only in plain text. In older Excel versions, these numbers are not used for calculations, but in Excel 2016, you can use them in all formulas except for functions like SUM and AVERAGE. The advantage of formatting dates and numbers in the form of text is that when you switch from Excel to a Word Mail Merge document, there is no clutter.
Format code for TEXT function
Below is the table of codes commonly used in the Text function.
Note : "0" and "#" act as placeholders for numbers but '0' forces 0 at the beginning or end, '#' will be replaced with a number if it is not top or bottom 0. Therefore, the code '00000' will ensure zero at the beginning is not removed in the New Jersey postal codes.
The codes for numbers, dates, and times can be used in Excel's TEXT or Custom number format. However, there is a difference between how these codes work in Excel and Word in Microsoft Office 2013. In Excel, you can use M or m for months or minutes. In most cases, Excel is smart enough to determine which unit you are using, but Word is not so smart, you need to use capital letters for the month, and write often for minutes. In addition, Excel has added the code 'MMMMM' to the result of a single abbreviation of the month (eg J, F, M, A, etc.)
Note: When converting these numbers in text, they are not used in SUM or AVERAGE functions, if you want, you need to convert them again using VALUE function.
ROUND function
Instead of the TEXT function, some users prefer to use the ROUND function to remove additional decimal numbers. The ROUND function will round the numbers up or down to the decimal place you specify. The advantage is that the rounding number is not in the form of text, you can still use them to calculate. ROUND function can work well in Mail Merge but rarely use them because:
In rare cases, ROUND function also displays errors in Mail Merge for example instead of 1.0014, Mail Merge, showing 1.0013.
The above two methods are relatively simple but you need to remember the format code and in some cases the same code but the usage is also different.
A simpler way is to link Word to Excel using DDE (Dynamic Data Exchange) links. It sounds complicated, but if you can merge mail then DDE cannot make it difficult for you. You only need to do two steps and the first step is to activate Word to open the file via DEE (this step only needs to be done once).
As mentioned above DDE does not work in Office 2016. Dynamic Data Exchange is an old technique and it seems that Microsoft is in the process of giving up it. Sometimes it works in Office 2016 and sometimes not. The trick for it to work in Office 2016 is that the Excel data source must be opened before accessing it from Word. And in Excel, the table must be started in the first row in the first worksheet in the file.
To set up a DDE link in Word 2013, follow the steps below:
Step 1 . Click on File> Options .
Step 2 . Click on the Advanced tab on the left and scroll in the General section.
Step 3 . Click Confirm file format conversion box on open .
This is the first step and you will not have to do it again. From now on, copies of Word will be opened in many different file types and opened with other paths including DDE. The disadvantage of this method is that every time you open a file other than a Word document in Microsoft Word, the program will let you change your choice.
The second step is the last step you need to do each time you select the data source for Mail Merge (before Step 3 of the Mail Merge tutorial or after clicking the Select Recipients button in the Mailings ribbon). Follow the steps below:
Step 1 . After selecting the data file you want to use, the Confirm Data Source dialog box will appear.
Step 2 . The default type is OLE but you can change it to another type. In the Confirm Data Source dialog box, click Show all . In the expanded file type list, select MS Excel Worksheets via DDE (* .xls) . (Select this option if using a newer Excel file format * .xlsx). If asked, confirm that you select Entire Spreadsheet .
If you have selected the spreadsheet for the Word document, you need to select it again, this time via the DDE link. From now on, Excel format will be transferred to Word Mail Merge document quite intact.
Warning : Make sure the document you want to merge must be in the first sheet of the Excel document.
Above are ways to fix formatting errors when using Mail Merge in Word. I wish you all success!