How to Fix Incorrect Word Mail Merge Results for Time Slots
Question details
The user needs to fix a mail merge document where adjacent rostered time slots display incorrectly (e.g., showing 11am to 1pm instead of 12pm to 2pm).
- Product
- Word Processing Software
- Device & OS
- not provided
- Scenario
- Generating a schedule or roster using mail merge with nested IF statements to format time slots.
- Observed behavior
- The mail merge combines adjacent time slots incorrectly due to syntax errors in the nested IF/THEN/ELSE field construction.
Press Alt+F9 (or Option+F9 on Mac) to toggle field codes on in your document. This is necessary to view and edit the underlying IF/THEN/ELSE statements that are causing the time slot error.
Correct the Syntax of Nested IF/THEN/ELSE Fields
Fix syntax errors, such as a missing equals sign, in your conditional merge fields to ensure time slots evaluate correctly.
Complex mail merges often rely on nested IF statements. If a single equals sign (=) or quotation mark is missing, the field logic will break and return the incorrect adjacent time slot.
Press Alt+F9 to toggle your document view from merged results to the raw field codes.
Find the fourth nested IF/THEN/ELSE construction (or the specific block handling the 12pm conditional logic).
Ensure the comparison uses correct syntax with an equals sign. It should look like this: { IF { MERGEFIELD Tuesday } = "12*" "12pm" ... }.
Press F9 to update the fields, then toggle field codes off (Alt+F9) to preview the results and verify the time slot now accurately displays as 12pm to 2pm.
Simplify the Time Slot Field Construction
Rewrite the mail merge fields into two separate logical blocks joined by the word 'to' for easier management and fewer nested errors.
Perform Flawless Mail Merges Using WPS Writer
WPS Writer offers a comprehensive Mail Merge feature that fully supports complex field codes, including nested IF/THEN/ELSE statements, ensuring your time slots and dynamic data format perfectly.
- 1. Open Mail Merge: Open your document in WPS Writer and navigate to the 'Mailings' or 'References' tab.
- 2. Link Data Source: Click 'Open Data Source' to connect your Excel spreadsheet containing the roster or schedule times.
- 3. Edit Conditional Fields: Use 'Insert Merge Field' to add your data, and press Alt+F9 to directly construct or fix complex { IF } conditional logic.
- 4. Preview Results: Click 'View Merged Data' to preview the rostered time slots and ensure your formatting works.

Frequently Asked Questions
Why do my mail merge fields show the formula instead of the result?
You likely have field codes toggled on in your document view. Press Alt+F9 (or Option+F9 on Mac) to hide the underlying { IF... } formulas and display the actual merged time slot results.
How do I insert an IF statement in a mail merge document?
You can insert an IF statement manually by pressing Ctrl+F9 to generate the special curly brackets { }, and then typing your logic (e.g., IF { MERGEFIELD Time } = "12pm" "Yes" "No"). Alternatively, use the 'Rules' > 'If...Then...Else' button located in the Mailings tab.
Why is an asterisk (*) used in the mail merge IF condition?
The asterisk acts as a wildcard character. For example, using "12*" matches any data source value that starts with '12'. This allows the IF statement to successfully handle slight variations in the time slot text without requiring an exact match.
How do I update field codes after editing the IF statement?
After making changes to the field code logic, select the entire field or document (Ctrl+A) and press F9. This forces the word processor to recalculate and display the updated merge results.




