How to Calculate Mail Merge Values from Multiple Word Fields
Question details
The user needs to calculate a new value in a mail merge document by mathematically combining data from two different merge fields.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating a mail merge form that requires dynamic mathematical calculations based on the source data (such as multiplying an Operations Sequence result by a Cycle Quantity).
- Observed behavior
- The user is unsure of the correct field coding syntax to perform mathematical operations on multiple merge fields within the document.
Ensure your data source (such as an Excel spreadsheet) is properly formatted and accessible, and back up your main mail merge document before inserting complex nested field codes.
Pre-calculate the Values in the Data Source
This is the most highly recommended and reliable method. Performing the calculation in your spreadsheet before executing the mail merge eliminates the need for complex Word field coding.
By using Excel or another spreadsheet tool to handle mathematical operations, you can easily verify the calculations are correct before bringing the data into Word.
Open the Excel workbook or database file that contains your mail merge data records.
Create a new column header for your calculated value. In the first data cell under the header, use a standard formula (e.g., =A2*B2) to multiply, add, or divide your target fields (like Operations Sequence and Cycle Quantity).
Drag the formula fill handle down to calculate the value for all records in your dataset. Save and close the data source file.
Open your Word mail merge document, reconnect the data source if prompted, and use the 'Insert Merge Field' button to place your newly calculated column directly into the document.

Use Nested Formula Fields in Word
Use this method if you cannot modify the original data source and must perform the calculation dynamically within the Word document itself.
Perform Advanced Mail Merges Seamlessly in WPS Office
WPS Office provides a fully integrated suite allowing you to easily manage your data sources in WPS Spreadsheet and execute advanced Mail Merges in WPS Writer. You can pre-calculate data effortlessly or handle complex document automation with familiar tools.
- 1. Prepare your data: Open WPS Spreadsheet to format your data and calculate any required fields using standard formulas.
- 2. Link the data source: Open your main document in WPS Writer. Navigate to the Mailings tab and click 'Open Data Source' to link your spreadsheet.
- 3. Insert and merge: Click 'Insert Merge Field' to place your calculated data fields. Click 'Merge to New Document' to generate your customized files instantly.

Frequently Asked Questions
Why are my calculated mail merge fields showing wrong numbers or not updating?
Word field codes do not always update automatically. To force an update, select your entire document by pressing Ctrl+A, then press F9 to refresh all field codes and calculations.
Can I combine text fields instead of calculating numbers?
Yes, to combine (concatenate) text fields, you do not need formula fields. Simply insert the merge fields side-by-side with a space in between, or use the CONCATENATE function in your Excel data source before merging.
How do I switch back and forth between viewing field codes and the actual values?
You can toggle the display between the underlying field codes (like { MERGEFIELD First_Name }) and their resulting values by pressing Alt+F9 on your keyboard.




