Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Angyl
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

I'm building a form in Word 2003 and adding code to the bookmarked fields to
perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards the total
builds upon previous calculations and all seems to come to screeching halt
(the form doesn't tally) if the result of any of the previous sections is
ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case that
field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my form.

Help!!


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

Perform the calculation outside a form field, using a calculation field then
trap the Syntax error e.g.

{ IF { ={ Emod } * { PremiumTotal } } = "!Syntax*" "$0.00" "{ ={ Emod } *
{ PremiumTotal } }" }

Here $0.00 is inserted in the result when Emod is empty otherwise the
calculation result is givcen.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Angyl wrote:
I'm building a form in Word 2003 and adding code to the bookmarked
fields to perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards
the total builds upon previous calculations and all seems to come to
screeching halt (the form doesn't tally) if the result of any of the
previous sections is ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case
that field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my
form.

Help!!



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

Hi Angyl,

Ordinarily, you'd use a formula field coded as:
{=Emod*PremiumTotal \# $,0.00}
and, if Emod hasn't been filled in, the result of the calculation would be
$0.00

If Emod is supposed to be a loading, then usually the calculation would be
something like:
=(Emod+1)*PremiumTotal
for which you'd use a formula field coded as:
{=(Emod+1)*PremiumTotal \# $,0.00}

In both cases the field braces (ie '{ }') are created in pairs via Ctrl-F9.

Cheers


"Angyl" wrote in message
...
I'm building a form in Word 2003 and adding code to the bookmarked fields

to
perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards the

total
builds upon previous calculations and all seems to come to screeching halt
(the form doesn't tally) if the result of any of the previous sections is
ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case that
field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my form.

Help!!




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Angyl
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

Thanks for the help, but the code is still not working. I've put what you
suggested in and the form is still producing a Zero, keeping the rest of the
form from functioning properly. It occured to me that there might be another
way if I could get some help with an IF statement on the calculations that
rely on the Emod that say something like this:

IF (Emod) = "0.00"
(nothing's been entered)
THEN This (LTotal) = (PremiumTotal)*(LLimit)

I see that the problem is that any number multiplied by Zero is Zero which
is why the EmodTotal field is returning a ZERO. I think I just need to put a
provision in the fields that follow it that reason; if the calculation is
ZERO, then ignore it...do something else instead.

"Graham Mayor" wrote:

Perform the calculation outside a form field, using a calculation field then
trap the Syntax error e.g.

{ IF { ={ Emod } * { PremiumTotal } } = "!Syntax*" "$0.00" "{ ={ Emod } *
{ PremiumTotal } }" }

Here $0.00 is inserted in the result when Emod is empty otherwise the
calculation result is givcen.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Angyl wrote:
I'm building a form in Word 2003 and adding code to the bookmarked
fields to perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards
the total builds upon previous calculations and all seems to come to
screeching halt (the form doesn't tally) if the result of any of the
previous sections is ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case
that field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my
form.

Help!!




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

Based on the information provided, the field requires some additional
conditions:

{IF{ ={ Emod } * { PremiumTotal } } = "!Syntax*" "{ ={ PremiumTotal } * {
LLimit } }" "{ IF{ Emod } = 0 "{ ={ PremiumTotal } * { LLimit } }" "{ ={
Emod } * { PremiumTotal } }" }" }


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Angyl wrote:
Thanks for the help, but the code is still not working. I've put
what you suggested in and the form is still producing a Zero, keeping
the rest of the form from functioning properly. It occured to me
that there might be another way if I could get some help with an IF
statement on the calculations that rely on the Emod that say
something like this:

IF (Emod) = "0.00"
(nothing's been entered)
THEN This (LTotal) = (PremiumTotal)*(LLimit)

I see that the problem is that any number multiplied by Zero is Zero
which is why the EmodTotal field is returning a ZERO. I think I just
need to put a provision in the fields that follow it that reason; if
the calculation is ZERO, then ignore it...do something else instead.

"Graham Mayor" wrote:

Perform the calculation outside a form field, using a calculation
field then trap the Syntax error e.g.

{ IF { ={ Emod } * { PremiumTotal } } = "!Syntax*" "$0.00" "{ ={
Emod } * { PremiumTotal } }" }

Here $0.00 is inserted in the result when Emod is empty otherwise the
calculation result is givcen.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Angyl wrote:
I'm building a form in Word 2003 and adding code to the bookmarked
fields to perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards
the total builds upon previous calculations and all seems to come to
screeching halt (the form doesn't tally) if the result of any of the
previous sections is ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case
that field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my
form.

Help!!





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

Hi Graham,

If Emod can only be integers (or, at least, 0 or any value = 1) you don't
need anything more complicated than:
{=MAX(Emod,1)*PremiumTotal \# $,0.00}
Alternatively, if Emod can sometimes be between 0 and 1:
{IF{=Emod}= 0 {=PremiumTotal} {=Emod*PremiumTotal} \# $,0.00}

Cheers

"Graham Mayor" wrote in message
...
Based on the information provided, the field requires some additional
conditions:

{IF{ ={ Emod } * { PremiumTotal } } = "!Syntax*" "{ ={ PremiumTotal } * {
LLimit } }" "{ IF{ Emod } = 0 "{ ={ PremiumTotal } * { LLimit } }" "{ ={
Emod } * { PremiumTotal } }" }" }


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Angyl wrote:
Thanks for the help, but the code is still not working. I've put
what you suggested in and the form is still producing a Zero, keeping
the rest of the form from functioning properly. It occured to me
that there might be another way if I could get some help with an IF
statement on the calculations that rely on the Emod that say
something like this:

IF (Emod) = "0.00"
(nothing's been entered)
THEN This (LTotal) = (PremiumTotal)*(LLimit)

I see that the problem is that any number multiplied by Zero is Zero
which is why the EmodTotal field is returning a ZERO. I think I just
need to put a provision in the fields that follow it that reason; if
the calculation is ZERO, then ignore it...do something else instead.

"Graham Mayor" wrote:

Perform the calculation outside a form field, using a calculation
field then trap the Syntax error e.g.

{ IF { ={ Emod } * { PremiumTotal } } = "!Syntax*" "$0.00" "{ ={
Emod } * { PremiumTotal } }" }

Here $0.00 is inserted in the result when Emod is empty otherwise the
calculation result is givcen.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Angyl wrote:
I'm building a form in Word 2003 and adding code to the bookmarked
fields to perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards
the total builds upon previous calculations and all seems to come to
screeching halt (the form doesn't tally) if the result of any of the
previous sections is ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case
that field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of my
form.

Help!!





  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Form Formula doesn't work if the result is ZERO?

I'll leave the clever mathematics to you
However, it works as written.
--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


macropod wrote:
Hi Graham,

If Emod can only be integers (or, at least, 0 or any value = 1) you
don't need anything more complicated than:
{=MAX(Emod,1)*PremiumTotal \# $,0.00}
Alternatively, if Emod can sometimes be between 0 and 1:
{IF{=Emod}= 0 {=PremiumTotal} {=Emod*PremiumTotal} \# $,0.00}

Cheers

"Graham Mayor" wrote in message
...
Based on the information provided, the field requires some additional
conditions:

{IF{ ={ Emod } * { PremiumTotal } } = "!Syntax*" "{ ={ PremiumTotal
} * { LLimit } }" "{ IF{ Emod } = 0 "{ ={ PremiumTotal } * { LLimit
} }" "{ ={ Emod } * { PremiumTotal } }" }" }


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Angyl wrote:
Thanks for the help, but the code is still not working. I've put
what you suggested in and the form is still producing a Zero,
keeping the rest of the form from functioning properly. It occured
to me that there might be another way if I could get some help with
an IF statement on the calculations that rely on the Emod that say
something like this:

IF (Emod) = "0.00"
(nothing's been entered)
THEN This (LTotal) = (PremiumTotal)*(LLimit)

I see that the problem is that any number multiplied by Zero is Zero
which is why the EmodTotal field is returning a ZERO. I think I
just need to put a provision in the fields that follow it that
reason; if the calculation is ZERO, then ignore it...do something
else instead.

"Graham Mayor" wrote:

Perform the calculation outside a form field, using a calculation
field then trap the Syntax error e.g.

{ IF { ={ Emod } * { PremiumTotal } } = "!Syntax*" "$0.00" "{ ={
Emod } * { PremiumTotal } }" }

Here $0.00 is inserted in the result when Emod is empty otherwise
the calculation result is givcen.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Angyl wrote:
I'm building a form in Word 2003 and adding code to the bookmarked
fields to perform calculations One example would be:

=(Gross1)*(Rate1)/100

The problem I'm having is that the latter part of the form towards
the total builds upon previous calculations and all seems to come
to screeching halt (the form doesn't tally) if the result of any
of the previous sections is ZERO or a Non Entry.

Specifically my problem is that one formula does this:

=(Emod)*(PremiumTotal)

But sometimes there IS no Emod so it is ZERO. If that is the case
that field shows ZERO (but there is a number in PremiumTotal)

With the resulting ZERO in that field, I can't finish the rest of
my form.

Help!!



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Form Fields - Can you Export to Excel Spreadsheet? elfmajesty Microsoft Word Help 11 April 18th 06 02:38 PM
Form for work; never done jjsevdt Microsoft Word Help 2 August 23rd 05 10:28 PM
macrobuttons and protected document saland1 Microsoft Word Help 10 May 24th 05 02:39 PM
macro doesn't work when I unprotect form mary Formatting Long Documents 1 May 3rd 05 07:35 PM
How do I get a formula "=SUM(ABOVE)" to work in a protected WORD . Monica Microsoft Word Help 1 February 22nd 05 04:42 PM


All times are GMT +1. The time now is 07:52 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"