If calculation field has 0 result, blank

C

cksiz

I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 
G

Graham Mayor

Wrap a QUOTE field around your calculated form field and add the switch to
the Quote field instead eg

{ QUOTE{ FORMTEXT { =Text1 * Text2 }} \# ",$0.00;;"}

or if the result could be negative

{ QUOTE{ FORMTEXT { =Text1 * Text2 }} \# ",$0.00;(,$0.00);"}

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

cksiz

Thank you. That document helped me in many other areas as well.

However, using a formula field for division of cells in the same table,
displays "!Zero Divide" until I have completed filling in the fields that are
used in the divide result.

For the fields that I am filling in, I have tried using the "Calculate on
exit" being both ON and OFF, but still get the zero divide message in my
formula field.

Is there a way to tell the formula field not to display anything until it
actually has valid numbers to perform the formula on?

macropod said:
Hi cksiz,

Save yourself some grief, use a formula field. To see why, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Calculations In Word Forms'. If you need to use the results in later calculations, you can
simply bookmark the formula field and cross-reference that.

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

cksiz said:
I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 
M

macropod

Hi cksiz,

You can suppress the zero divide message via an IF test. For example:
{IF{=Divisor}= 0 "" {=Dividend/Divisor}}
where 'Dividend' & 'Divisor are the bookmark names of the relevant formfields. You may also want to add an appropriate numeric
picture switch to format the 'correct' division result.

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

cksiz said:
Thank you. That document helped me in many other areas as well.

However, using a formula field for division of cells in the same table,
displays "!Zero Divide" until I have completed filling in the fields that are
used in the divide result.

For the fields that I am filling in, I have tried using the "Calculate on
exit" being both ON and OFF, but still get the zero divide message in my
formula field.

Is there a way to tell the formula field not to display anything until it
actually has valid numbers to perform the formula on?

macropod said:
Hi cksiz,

Save yourself some grief, use a formula field. To see why, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Calculations In Word Forms'. If you need to use the results in later calculations, you
can
simply bookmark the formula field and cross-reference that.

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

cksiz said:
I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 
C

cksiz

Thats just bootiful.
Thank you very much.

macropod said:
Hi cksiz,

You can suppress the zero divide message via an IF test. For example:
{IF{=Divisor}= 0 "" {=Dividend/Divisor}}
where 'Dividend' & 'Divisor are the bookmark names of the relevant formfields. You may also want to add an appropriate numeric
picture switch to format the 'correct' division result.

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

cksiz said:
Thank you. That document helped me in many other areas as well.

However, using a formula field for division of cells in the same table,
displays "!Zero Divide" until I have completed filling in the fields that are
used in the divide result.

For the fields that I am filling in, I have tried using the "Calculate on
exit" being both ON and OFF, but still get the zero divide message in my
formula field.

Is there a way to tell the formula field not to display anything until it
actually has valid numbers to perform the formula on?

macropod said:
Hi cksiz,

Save yourself some grief, use a formula field. To see why, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Calculations In Word Forms'. If you need to use the results in later calculations, you
can
simply bookmark the formula field and cross-reference that.

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

I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 
C

cksiz

But is a "blank" form field, actually 0?
I tried the IF logic, however now the results do not display anything.
Its almost like if the form field is "blank", there is SOMETHING in there,
but what?
With the IF now, even if I put values in my dividend and divisor, it will
not display the results.

Sorry, this must seem very basic to you, but I guess I'm just not
understanding how word handles null form fields.
My formula is below. all values are within the same table, so I am using
cell references (just to note, using the bookmark name for the form fields
produces the same results)

{IF{=B4} = 0 "" {=B4/B6} }

also tried
{IF{=Bkmrk1} = 0 "" {=Bkmrk1/Bkmrk3} }
{IF{=Bkmrk1} = "" "" {=Bkmrk1/Bkmrk3} }
also tried unchecking "calculate on exit" on all fields, except the last one
(essentially, dont calculate anything until the last field has been entered)
But as soon as you hit protect, the formula field does its evaluation, or
leaves the value from the last time i tried.
macropod said:
Hi cksiz,

You can suppress the zero divide message via an IF test. For example:
{IF{=Divisor}= 0 "" {=Dividend/Divisor}}
where 'Dividend' & 'Divisor are the bookmark names of the relevant formfields. You may also want to add an appropriate numeric
picture switch to format the 'correct' division result.

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

cksiz said:
Thank you. That document helped me in many other areas as well.

However, using a formula field for division of cells in the same table,
displays "!Zero Divide" until I have completed filling in the fields that are
used in the divide result.

For the fields that I am filling in, I have tried using the "Calculate on
exit" being both ON and OFF, but still get the zero divide message in my
formula field.

Is there a way to tell the formula field not to display anything until it
actually has valid numbers to perform the formula on?

macropod said:
Hi cksiz,

Save yourself some grief, use a formula field. To see why, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Calculations In Word Forms'. If you need to use the results in later calculations, you
can
simply bookmark the formula field and cross-reference that.

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

I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 
M

macropod

Hi cksiz,

You need to ensure all those braces (ie '{ }') are created via Ctrl-F9 - you con't simply type them in. You also need to make sure
the formfields in B4 & B6 both have their properties set to 'calculate on exit'.

Your {IF{=B4} = 0 "" {=B4/B6} } construction should then work fine.

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

cksiz said:
But is a "blank" form field, actually 0?
I tried the IF logic, however now the results do not display anything.
Its almost like if the form field is "blank", there is SOMETHING in there,
but what?
With the IF now, even if I put values in my dividend and divisor, it will
not display the results.

Sorry, this must seem very basic to you, but I guess I'm just not
understanding how word handles null form fields.
My formula is below. all values are within the same table, so I am using
cell references (just to note, using the bookmark name for the form fields
produces the same results)

{IF{=B4} = 0 "" {=B4/B6} }

also tried
{IF{=Bkmrk1} = 0 "" {=Bkmrk1/Bkmrk3} }
{IF{=Bkmrk1} = "" "" {=Bkmrk1/Bkmrk3} }
also tried unchecking "calculate on exit" on all fields, except the last one
(essentially, dont calculate anything until the last field has been entered)
But as soon as you hit protect, the formula field does its evaluation, or
leaves the value from the last time i tried.
macropod said:
Hi cksiz,

You can suppress the zero divide message via an IF test. For example:
{IF{=Divisor}= 0 "" {=Dividend/Divisor}}
where 'Dividend' & 'Divisor are the bookmark names of the relevant formfields. You may also want to add an appropriate numeric
picture switch to format the 'correct' division result.

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

cksiz said:
Thank you. That document helped me in many other areas as well.

However, using a formula field for division of cells in the same table,
displays "!Zero Divide" until I have completed filling in the fields that are
used in the divide result.

For the fields that I am filling in, I have tried using the "Calculate on
exit" being both ON and OFF, but still get the zero divide message in my
formula field.

Is there a way to tell the formula field not to display anything until it
actually has valid numbers to perform the formula on?

:

Hi cksiz,

Save yourself some grief, use a formula field. To see why, check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Calculations In Word Forms'. If you need to use the results in later calculations, you
can
simply bookmark the formula field and cross-reference that.

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

I have several rows in a table, with the last column being a calculated form
field of A1*B1.
The table has 10 rows, but the user might only fill in 1 or 2 of the rows.
For the rows that have no data (essentially, blank Col1 and Col2), the total
column always displays a 0 value.
How can I make this field display BLANK (or null if you will) if Col1 and
Col2 are blank?
I know a formula field will do this, but I need it to be a form field,
because I use these field further down in more calculations. (essentially
need the bookmark name, and a formula field in word does not have a name, so
I must use a form field)

I have tried formatting the field, as suggested in this webpage
http://www.gmayor.com/formatting_word_fields.htm

And putting the switch as part of the formatting, however, to no avail.
\# "$0;($0);"
 

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