How to Create Conditional Word Mail Merge Fields for Blank Excel Values
Question details
The user needs to prevent blank Excel cells from appearing as zeros in a Word mail merge by using conditional IF fields.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Generating a mail merge document where the source data contains blank cells that need to be skipped or replaced with fallback text instead of displaying a "0".
- Observed behavior
- Word mail merge interprets and displays blank Excel cells as zero values, which disrupts the formatting of salutations, organization names, or other text.
Ensure your Excel data source is saved and accessible. While you can use Word field codes, it is often simpler to clean blank values directly in Excel or via Power Query before initiating the mail merge.
Use Nested IF Fields in Word to Handle Blank Values
Toggle field codes in your Word document to insert conditional logic that checks for blank or zero values and outputs the correct fallback text.
By modifying the raw field codes in Word, you can tell the mail merge exactly how to behave when it encounters a blank cell or a zero from Excel. This method ensures your document looks professional without permanently altering your source data.
Open your mail merge document in Word and press Alt + F9 on your keyboard to reveal the underlying field codes.
Click where you want the conditional text to appear and press Ctrl + F9. This inserts a special pair of curly braces { }. Do not type these manually, as Word will not recognize them as field codes.
Inside the braces, type your IF statement. For example: { IF { MERGEFIELD Organization } = "" "Fallback Text" "{ MERGEFIELD Organization }" }. This checks if the Organization field is empty, outputs 'Fallback Text' if true, and outputs the actual organization name if false.
Press Alt + F9 again to hide the field codes, then click 'Preview Results' in the Mailings tab to verify that the blank values are handled correctly.

Clean Blank Cells in Excel Before Merging
Prevent zeros from appearing by replacing blank cells in your Excel data source with spaces or fallback text before merging.
Easily Manage Mail Merges with WPS Writer
WPS Writer offers a highly intuitive Mail Merge feature that seamlessly integrates with WPS Spreadsheet data. You can easily insert merge fields, preview results, and manage your data sources without dealing with complicated syntax.
- 1. Prepare your document: Open your letter or template in WPS Writer and navigate to the 'References' or 'Mailings' tab.
- 2. Connect the data source: Click 'Mail Merge', select 'Open Data Source', and choose your corresponding WPS Spreadsheet file.
- 3. Insert fields and merge: Use the 'Insert Merge Field' button to place data points in your document, preview the output, and click 'Merge to New Document' to finalize.

Frequently Asked Questions
Why does my Word mail merge show a 0 instead of a blank?
When Word connects to an Excel data source via OLE DB, it often interprets empty numeric or general formatted cells as a mathematical zero. Using conditional IF fields in Word or formatting the Excel column explicitly as Text can resolve this issue.
What is the keyboard shortcut to view field codes in Word?
You can toggle the display of field codes in Word by pressing Alt + F9 on Windows. This allows you to view and edit the raw syntax of your MERGEFIELDs.
How do I insert a blank field code brace?
Press Ctrl + F9 to insert a new, valid pair of field code braces { }. Typing the curly brackets manually using your keyboard will just insert regular text, and Word will not recognize it as a functioning field code.




