How to format numbers in Mail Merge correctly

When you need to personalize contracts and other documents, Word’s Mail Merge is the go-to tool. However, number fields don’t always show up in the format you want. I’ve put together a set of formulas to help you format numbers in Mail Merge correctly, and I’ll also show you how to keep the number format from Excel.

Basic number formatting in Mail Merge

To change how a merge field displays its number, you need to switch it to Field Codes view. Let’s go through these basic steps first.

Step 1: Right-click the merge field and select Toggle Field Codes. You can also click the field and press Shift + F9.

Switch to Field Codes view to add number formats in Mail Merge
Switch to Field Codes view to add number formats in Mail Merge

Step 2: By default, the field code looks like {MERGEFIELD field_name}. To add a number format to the field, you add a format code after field_name. As an example, let’s say I have an Excel file with these columns.

DateNumberPercent x 100Percent
February 14, 2021500000.78996.690.9669

In Mail Merge, to display the number 500000.789 as 500,001, I change the field code to {MERGEFIELD field_name \# #,##0}.

Example of formatting numbers with thousands separators in Mail Merge
Example of formatting numbers with thousands separators in Mail Merge

That’s the basic way to change a number format in Mail Merge. Next, let’s look at other formats such as dates, percentages and decimals.

Mail Merge number format formulas

The table below lists common formulas for formatting numbers in Mail Merge. Pick and combine them depending on what you need.

TargetFormulaDisplay
Day/month/year\@ dd/MM/yyyy14/02/2021
Day\@ dd14
Month\@ MM02
Year\@ yyyy2021
Hours and minutes\@ HH:mm17:30
Hours, minutes, and seconds\@ HH:mm:ss17:30:15
Thousands separator\# #,##0500,001
Thousands separator with 3 decimal places\# #,##0.000500,000.789
Vietnamese currency\# #,##0₫500,001₫
Dollar currency\# $#,##0.00$500,000.79
Percentage (multiplied by 100 in Excel)\# 0%97%
Percentage (multiplied by 100 in Excel) with 2 decimal places\# 0.00%96.69%
Percentage (not multiplied by 100 in Excel){={MERGEFIELD field_name}*100 \# 0%}97%
Percentage (not multiplied by 100 in Excel) with 2 decimal places{={MERGEFIELD field_name}*100 \# 0.00%}96.69%

If you run into errors with the Percentage (not multiplied by 100 in Excel) formulas, the easiest fix is to multiply by 100 in Excel and use the other percentage formula instead. What matters is that the number shows correctly in Mail Merge. Going back to the original example, here is how I add a number format formula to the field code of every field.

Use formulas to format numbers in Mail Merge
Use formulas to format numbers in Mail Merge
Video tutorial for formatting numbers in Mail Merge

Use number formatting from Excel

Change the Confirm Data Source setting

On Windows, after you select the data source, choose MS Excel Worksheets via DDE (*.xls) in the Confirm Data Source dialog box.

Preserve number formatting from Excel in Mail Merge
Preserve number formatting from Excel in Mail Merge

On macOS, Mail Merge in Office for Mac uses the number format from Excel by default.

Add a line of text below the field name

If the formulas still give you trouble, try this workaround. Insert a new row right below the header row in Excel, then type any text into the number columns. Mail Merge will then treat those columns as text and keep the values exactly as they appear in Excel.

Conclusion

I hope these methods help your Mail Merge work go smoothly. Leave a comment below to share your results or ask any questions. Good luck!

Hieu Tran Ngoc Minh

Hieu (born in 1996) holds a Bachelor's degree in Business Administration from Saigon Technology University. Currently a Data Analyst at Ninja Van, Hieu has extensive experience in Data Analysis and Digital Marketing. This blog is where Hieu shares practical experiences from work and life.

Leave a Comment

Feel free to leave your comment (preferably in English), and we will review and respond as soon as possible. Please use a real email to ensure your comment is approved and to receive notifications when we reply. You can also add an avatar to your email.