Zip Code field returns 00000 when nothing in field in from xls

K

Kim

I am using Grant's formula for 5 and 9 digit zip codes:

{If{MERGEFIELD ZIP} > 99999 "{MERGEFIELD ZIP \# "00000'-'0000"}"
"{MERGEFIELD ZIP \# "00000"}}

And it works like a charm, except when the cell is empty in Excel. I
get "00000" instead of a blank field. How do I suppress the zeros when
there is nothing in the field?

Thanks!
Kim
 
M

macropod

Hi Kim,

Try adding two ';;' characters to the end of the 2nd mergefield field, thus:
{If{MERGEFIELD ZIP} > 99999 "{MERGEFIELD ZIP \# "00000'-'0000"}"
"{MERGEFIELD ZIP \# "00000;;"}}

Those extra characters control the formatting for negative and 0 values, respectively. Having nothing after each of them suppresses
the negative and 0 value display.

Cheers
 
K

Kim

Hi Kim,

Try adding two ';;' characters to the end of the 2nd mergefield field, thus:
{If{MERGEFIELD ZIP} > 99999 "{MERGEFIELD ZIP \# "00000'-'0000"}"
"{MERGEFIELD ZIP \# "00000;;"}}

Those extra characters control the formatting for negative and 0 values, respectively. Having nothing after each of them suppresses
the negative and 0 value display.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------



Kim said:
I am using Grant's formula for 5 and 9 digit zip codes:
{If{MERGEFIELD ZIP} > 99999 "{MERGEFIELD ZIP \# "00000'-'0000"}"
"{MERGEFIELD ZIP \# "00000"}}
And it works like a charm, except when the cell is empty in Excel. I
get "00000" instead of a blank field. How do I suppress the zeros when
there is nothing in the field?
Thanks!
Kim- Hide quoted text -

- Show quoted text -

Worked like a charm! I can't thank you enough!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top