I am using an excel spreadsheet to populate a Mail merge document. What i would like to do is if a certain value on the spreadsheet is not zero display some text along with this value. Is this possible. Any help appreciated.
In your Word mailmerge document, click on the errant mailmerge field and press Shift-F9. This should expose the field code, which will look something like:
{MAILMERGE ExcelData}
to supress 0 output, add a numeric picture switch to the field, thus:
{MAILMERGE ExcelData \# ,0;-,0;}
For dollars and cents, you could use:
{MAILMERGE ExcelData \# $,0.00;-$,0.00;}
The numeric picture switch works similarly to cell formatting in Excel, with three parameters - +ve values, -ve values and 0 values, each separated by a semi-colon. The lack of anything after the second semi-colon suppresses 0 outputs.
If your mailmerge is inline with text in your document and you also want to suppress the extra space that a suppressed 0 would leave behind, use something like:
{MAILMERGE ExcelData \# ",0 ;-,0 ;"}
or
{MAILMERGE ExcelData \# "$,0.00 ;-$,0.00 ;"}
and omit the space after the mailmerge field - it will put it's own in for non-zero values.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.