Re: blank when zero

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jean-Guy Marcil (no-spam_at_leaveme.alone)
Date: 09/30/04


Date: Thu, 30 Sep 2004 15:27:20 -0400

Bonjour,

Dans son message, < Greg > écrivait :
In this message, < Greg > wrote:

|| Suzanne,
||
|| Have you tested this? Unless you have talked to him and
|| have inside information, his price and quantity fields
|| are "blank" (his words where "nothing on the line") and
|| the actual calculation is a syntax error. The from
|| calculation field masks this with a 0.00 display using the
|| switch you provided. Even if I enter 0 in either of the
|| two variable fields or both I am still getting a display
|| 0.00 in the calculation field using your switch.
||
|| While your switch will mask the 0 result if both variables
|| are 0 in a regular formula field {=({Text1}*{Text2}) \#
|| #,##0.00;(#,##0.00);''}, if either is blank a syntax error
|| is returned.
||

(BTW, you are missing a double quote in your formula... Between \# and the
first #. A typo?)

I have just tested it on Word 2002.

I used a 3col x 5row table.

I put the following field in the third cell of the first row (C1):
{=({=A1}*{=B1}) \# "# ##0,00;(# ##0,00);''}

C1 is always empty if A1 or B1 are either empty or contain a zero. If both
A1 and B1 contain non-zero numbers, then the result is properly displayed.
The switch works as expected on my machine.

OTOH, I think that if you had
    {=({=A1}/{=B1}) \# "# ##0,00;(# ##0,00);''}
then something like what you posted would be necessary to handle the Divide
by zero error message.

-- 
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


Relevant Pages

  • Re: How to preserve format on cross-references when update
    ... The macro sets the switch initially to off, but when it is set to on it ... Word MVP web site http://word.mvps.org ... or hard formatting)? ...
    (microsoft.public.word.docmanagement)
  • Re: Search and replace involving a field
    ... field code doesn't have \h switch. ... If I have a file without the macro and do the insert and cross-reference ... Please reply to the newsgroup unless you wish to avail yourself of my ... Doug Robbins - Word MVP ...
    (microsoft.public.word.vba.general)
  • Re: formatting numeric data from Access merged into a Word table
    ... Word MVP web site http://word.mvps.org ... does Excel bring over Field Properties from Access? ... like '{MERGEFIELD MyData}', where 'MyData' is your data field's name ... will I have to make these switch changes in the table in Word ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How to preserve format on cross-references when update
    ... The macro sets the switch initially to off, but when it is set to on it gives the user the choice of mergeformat or charformat. ... Word MVP web site http://word.mvps.org ... macropod wrote: ... or hard formatting)? ...
    (microsoft.public.word.docmanagement)
  • Re: How to preserve format on cross-references when update
    ... The macro sets the switch initially to off, but when it is set to on it gives the user the choice of mergeformat or charformat. ... Word MVP web site http://word.mvps.org ... macropod wrote: ... or hard formatting)? ...
    (microsoft.public.word.docmanagement)