Formatting Issues

How to Format Blank Excel Cells in Word Mail Merge Percentages

Elise WilliamsElise Williams Oct 21, 2026 873 views

Question details

The user needs a way to format Excel percentage values within a Word mail merge while preventing syntax errors caused by blank source cells by displaying an 'n/a' placeholder.

How to Format Blank Excel Cells as n/a in Word Mail Merge Percentages
Product
Word
Device & OS
not provided
Scenario
Generating a merged document from an Excel data source that contains a column of percentage values where some rows have empty cells.
Observed behavior
When the mail merge encounters a blank Excel cell and attempts to apply a percentage format switch, it produces a syntax error instead of gracefully handling the missing data.
Before you start

Ensure your Excel data source is successfully linked to your Word document, and make a note of the exact column header name that contains your percentage values.

Solution 1Recommended

Use an IF Field Code to Handle Blank Cells

You can use an IF field code to logically test if the incoming data is blank. If it is blank, it outputs 'n/a'; if it contains data, it applies your designated percentage formatting.

By nesting MERGEFIELD codes within an IF field, you instruct the word processor to evaluate the cell's content before attempting to apply any formatting. This prevents the formatting engine from throwing a syntax error on a null value.

1
Reveal Document Field Codes

Press Alt+F9 on your keyboard to toggle the view from the merged results to the underlying field codes.

2
Insert the Outer IF Field Braces

Press Ctrl+F9 to insert a blank pair of field code braces { }. Note that you must use this keyboard shortcut; typing curly braces manually with your keyboard will not work.

3
Construct the IF Statement

Inside the braces, begin typing the logic. You will need to press Ctrl+F9 again whenever you need to insert a MERGEFIELD. The structure should look exactly like this: { IF { MERGEFIELD YourColumnName } = "" "n/a" "{ MERGEFIELD YourColumnName \# "0.00%" }" }.

4
Update and Preview Results

Press Alt+F9 to hide the field codes and return to the normal view. Select the field (or press Ctrl+A to select everything) and press F9 to update the fields, then preview your mail merge to see 'n/a' for blank cells and correctly formatted percentages elsewhere.

Use an IF Field Code to Handle Blank Cells
Crucial Keystroke: Always remember to insert every field-code brace pair using Ctrl+F9. If you type { and } manually, the word processor will treat them as regular text and the merge rule will fail.
Efficient Mail Merge

Perform Seamless Mail Merges with WPS Office

WPS Office provides a highly compatible and intuitive Mail Merge feature. You can easily link WPS Spreadsheet data to your WPS Writer documents, seamlessly apply specific formatting to numbers and percentages, and confidently utilize standard field codes to handle blank cells.

  1. 1. Open the Mail Merge Ribbon: Launch WPS Writer, navigate to the 'References' tab, and click on 'Mail Merge' to activate the tool.
  2. 2. Link Your Data Source: Click 'Open Data Source' and select the WPS Spreadsheet file that contains your percentage data and empty cells.
  3. 3. Insert Merge Fields: Click 'Insert Merge Field' to place your data points into the document exactly where you need them.
  4. 4. Apply Advanced Formatting: Use Ctrl+F9 to embed IF conditions and formatting switches directly into your WPS Writer document to seamlessly handle blank cells.
Fully compatible with Microsoft Word .docx and Excel .xlsx file formatsIntuitive Mail Merge wizard to effortlessly map complex data fieldsRobust support for advanced field codes, including IF conditions and numeric switchesLightweight, fast, and completely free to use for your daily office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does a blank Excel cell cause a syntax error in a Word mail merge?

When the word processor encounters an empty cell but is instructed to format it as a number or a percentage using a numeric switch (like \# "0.00%"), it cannot calculate or process the missing value, triggering a syntax error. Using conditional logic bypasses the formatting attempt on empty values.

Can I type the curly braces { } manually for mail merge field codes?

No. Manually typing curly braces on your keyboard will only insert regular text characters. You must use the shortcut Ctrl+F9 to insert functional field code brackets recognized by the software.

How do I switch between viewing field codes and merge results?

You can toggle the display between the underlying field codes and the actual text values by pressing Alt+F9 on your keyboard.

What switch is used to format a mail merge field as a percentage?

To format a mail merge field as a percentage, you add a numeric picture switch to the end of the merge field code, for example: \# "0.00%". Depending on how your Excel data is formatted, you may also need to multiply the field by 100 within a formula field.