Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
jlawson jlawson is offline
external usenet poster
 
Posts: 25
Default IF statement problem !Syntax Error, !

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !

{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet),{
IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtEC2+txtEC3+
txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtEC 7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6 +txtEC7)
}) }

Thank you in advance!

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default IF statement problem !Syntax Error, !

Hi Jlawson,

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

What are these fields, more exactly? Are they form fields in the document? Mail
merge fields? Something else?

With very few exceptions, you can't type a field's name into another field (the IF
field, here). Word won't recognize it as a field and doesn't know where the
ifnormation is coming from. The names must also be in fields. But the kind of field
you can use depends very much on where the original information is coming from...

and as long as we're playing q&a: Which version of word are you using?

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !


{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet)
,{

IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtE
C2+txtEC3+

txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5
+txtEC6+txtEC7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtE
C4+txtEC5+txtEC6+txtEC7)
}) }


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
jlawson jlawson is offline
external usenet poster
 
Posts: 25
Default IF statement problem !Syntax Error, !

Thank you for the reply! I'm using MS Word XP. These are form fields
in my document. They are set to number with dollar formats; each form
field has a bookmark name list below and set to calculate on exit. The
calculation will be just a field. The idea is we call the patient on
the phone pre-register them for their hospital visit and give them an
estimated quote for services based on the patient's insurance
information. We find out how much the patient owes on their
deductible, what percentage the insurance company will pay and what the
patient out of pocket expense is.

For example, you have 300 dollars left on your deductible and 80%
coverage and a 2000 dollar out of pocket. Say you have some blood work
for $120 dollars; your estimated cost is $120. If you had an MRI the
estimated hospital cost would be $1200, you would pay $300 and the
insurance company would pay 80% leaving you with $300 plus 20% = $480.
If you needed a pacemaker it alone would cost $120,000, instead of
paying $23,940 for the pacemaker you would just pay $2000 because you
do not pay more then your out of pocket expense.

There would be some slight changes depending on our insurance company
plan. Sorry, if I confused anyone.


Cindy M -WordMVP- wrote:
Hi Jlawson,

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

What are these fields, more exactly? Are they form fields in the document? Mail
merge fields? Something else?

With very few exceptions, you can't type a field's name into another field (the IF
field, here). Word won't recognize it as a field and doesn't know where the
ifnormation is coming from. The names must also be in fields. But the kind of field
you can use depends very much on where the original information is coming from...

and as long as we're playing q&a: Which version of word are you using?

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !


{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet)
,{

IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtE
C2+txtEC3+

txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5
+txtEC6+txtEC7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtE
C4+txtEC5+txtEC6+txtEC7)
}) }


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default IF statement problem !Syntax Error, !

Hi Josh,

Thank you for the reply! I'm using MS Word XP. These are form fields
in my document. They are set to number with dollar formats; each form
field has a bookmark name list below and set to calculate on exit. The
calculation will be just a field. The idea is we call the patient on
the phone pre-register them for their hospital visit and give them an
estimated quote for services based on the patient's insurance
information. We find out how much the patient owes on their
deductible, what percentage the insurance company will pay and what the
patient out of pocket expense is.

OK, then what you need to do in the "IF" is turn each of these formfield (bookmark) names
into a REF field. Select each name (double-click should work) the press Ctrl+F9. The
result should look something like:
{ txtEC1 }

Actually, Word might even work with it, just like that. But sometimes not, so it's safer
to edit the result:
{ REF txtEC1 }

Next, you don't use parentheses in IF fields to group the test/true/false; Word IF fields
use "quotes". And an mathematical equation must also be in a field. So, very roughly:
{ IF { = {Ref txtEC1}+{REF txtEc2} } { = { REF OPNet }- { REF OPMet } } "true here"
"false here" }

A long complicated formula is a PITA to work with in Word :-) If this were mail merge,
I'd suggest using Excel or Access for the data and doing the calculations in an
additional column. In this case, unless macro security is a problem, I'd probably be
tempted to put the calculation in a macro and just dump in the result...

For example, you have 300 dollars left on your deductible and 80%
coverage and a 2000 dollar out of pocket. Say you have some blood work
for $120 dollars; your estimated cost is $120. If you had an MRI the
estimated hospital cost would be $1200, you would pay $300 and the
insurance company would pay 80% leaving you with $300 plus 20% = $480.
If you needed a pacemaker it alone would cost $120,000, instead of
paying $23,940 for the pacemaker you would just pay $2000 because you
do not pay more then your out of pocket expense.

There would be some slight changes depending on our insurance company
plan. Sorry, if I confused anyone.


Cindy M -WordMVP- wrote:
Hi Jlawson,

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

What are these fields, more exactly? Are they form fields in the document? Mail
merge fields? Something else?

With very few exceptions, you can't type a field's name into another field (the IF
field, here). Word won't recognize it as a field and doesn't know where the
ifnormation is coming from. The names must also be in fields. But the kind of field
you can use depends very much on where the original information is coming from...

and as long as we're playing q&a: Which version of word are you using?

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !


{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet)
,{

IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtE
C2+txtEC3+

txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5
+txtEC6+txtEC7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtE
C4+txtEC5+txtEC6+txtEC7)
}) }



Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :-)

  #5   Report Post  
Posted to microsoft.public.word.docmanagement
jlawson jlawson is offline
external usenet poster
 
Posts: 25
Default IF statement problem !Syntax Error, !

Have a Root Cert from VeriSign for Macros in Office. I'm stuck using
Word because I can lock the form and keep the staff from changing it.
They are not too computer savvy so I was trying to make something easy
for them to use. When I was experimenting with macros on this form
they pitched a fit because a field form was left blank. What would one
look like because I just started learning macros a couple of weeks ago?



Cindy M -WordMVP- wrote:
Hi Josh,

Thank you for the reply! I'm using MS Word XP. These are form fields
in my document. They are set to number with dollar formats; each form
field has a bookmark name list below and set to calculate on exit. The
calculation will be just a field. The idea is we call the patient on
the phone pre-register them for their hospital visit and give them an
estimated quote for services based on the patient's insurance
information. We find out how much the patient owes on their
deductible, what percentage the insurance company will pay and what the
patient out of pocket expense is.

OK, then what you need to do in the "IF" is turn each of these formfield (bookmark) names
into a REF field. Select each name (double-click should work) the press Ctrl+F9. The
result should look something like:
{ txtEC1 }

Actually, Word might even work with it, just like that. But sometimes not, so it's safer
to edit the result:
{ REF txtEC1 }

Next, you don't use parentheses in IF fields to group the test/true/false; Word IF fields
use "quotes". And an mathematical equation must also be in a field. So, very roughly:
{ IF { = {Ref txtEC1}+{REF txtEc2} } { = { REF OPNet }- { REF OPMet } } "true here"
"false here" }

A long complicated formula is a PITA to work with in Word :-) If this were mail merge,
I'd suggest using Excel or Access for the data and doing the calculations in an
additional column. In this case, unless macro security is a problem, I'd probably be
tempted to put the calculation in a macro and just dump in the result...

For example, you have 300 dollars left on your deductible and 80%
coverage and a 2000 dollar out of pocket. Say you have some blood work
for $120 dollars; your estimated cost is $120. If you had an MRI the
estimated hospital cost would be $1200, you would pay $300 and the
insurance company would pay 80% leaving you with $300 plus 20% = $480.
If you needed a pacemaker it alone would cost $120,000, instead of
paying $23,940 for the pacemaker you would just pay $2000 because you
do not pay more then your out of pocket expense.

There would be some slight changes depending on our insurance company
plan. Sorry, if I confused anyone.


Cindy M -WordMVP- wrote:
Hi Jlawson,

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

What are these fields, more exactly? Are they form fields in the document? Mail
merge fields? Something else?

With very few exceptions, you can't type a field's name into another field (the IF
field, here). Word won't recognize it as a field and doesn't know where the
ifnormation is coming from. The names must also be in fields. But the kind of field
you can use depends very much on where the original information is coming from...

and as long as we're playing q&a: Which version of word are you using?

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !


{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet)
,{

IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtE
C2+txtEC3+

txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5
+txtEC6+txtEC7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtE
C4+txtEC5+txtEC6+txtEC7)
}) }



Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :-)




  #6   Report Post  
Posted to microsoft.public.word.docmanagement
jlawson jlawson is offline
external usenet poster
 
Posts: 25
Default IF statement problem !Syntax Error, !


Ok, i got the formula to work but it gives me error messages when i
have the REF form field blank or in a dollar amount. Is there a way
around this?

jlawson wrote:
Have a Root Cert from VeriSign for Macros in Office. I'm stuck using
Word because I can lock the form and keep the staff from changing it.
They are not too computer savvy so I was trying to make something easy
for them to use. When I was experimenting with macros on this form
they pitched a fit because a field form was left blank. What would one
look like because I just started learning macros a couple of weeks ago?



Cindy M -WordMVP- wrote:
Hi Josh,

Thank you for the reply! I'm using MS Word XP. These are form fields
in my document. They are set to number with dollar formats; each form
field has a bookmark name list below and set to calculate on exit. The
calculation will be just a field. The idea is we call the patient on
the phone pre-register them for their hospital visit and give them an
estimated quote for services based on the patient's insurance
information. We find out how much the patient owes on their
deductible, what percentage the insurance company will pay and what the
patient out of pocket expense is.

OK, then what you need to do in the "IF" is turn each of these formfield (bookmark) names
into a REF field. Select each name (double-click should work) the press Ctrl+F9. The
result should look something like:
{ txtEC1 }

Actually, Word might even work with it, just like that. But sometimes not, so it's safer
to edit the result:
{ REF txtEC1 }

Next, you don't use parentheses in IF fields to group the test/true/false; Word IF fields
use "quotes". And an mathematical equation must also be in a field. So, very roughly:
{ IF { = {Ref txtEC1}+{REF txtEc2} } { = { REF OPNet }- { REF OPMet } } "true here"
"false here" }

A long complicated formula is a PITA to work with in Word :-) If this were mail merge,
I'd suggest using Excel or Access for the data and doing the calculations in an
additional column. In this case, unless macro security is a problem, I'd probably be
tempted to put the calculation in a macro and just dump in the result...

For example, you have 300 dollars left on your deductible and 80%
coverage and a 2000 dollar out of pocket. Say you have some blood work
for $120 dollars; your estimated cost is $120. If you had an MRI the
estimated hospital cost would be $1200, you would pay $300 and the
insurance company would pay 80% leaving you with $300 plus 20% = $480.
If you needed a pacemaker it alone would cost $120,000, instead of
paying $23,940 for the pacemaker you would just pay $2000 because you
do not pay more then your out of pocket expense.

There would be some slight changes depending on our insurance company
plan. Sorry, if I confused anyone.


Cindy M -WordMVP- wrote:
Hi Jlawson,

I created a IF, THEN, ELSE field in word that is based on certain
fields that the user will fill in.

What are these fields, more exactly? Are they form fields in the document? Mail
merge fields? Something else?

With very few exceptions, you can't type a field's name into another field (the IF
field, here). Word won't recognize it as a field and doesn't know where the
ifnormation is coming from. The names must also be in fields. But the kind of field
you can use depends very much on where the original information is coming from...

and as long as we're playing q&a: Which version of word are you using?

OPNet = $5,000
OPMet = $2,000

DedNet = $1,000
DedMet = $100

NetPer = 80%

txtEC1 = $100
txtEC2 = $2500
etc...

This is what I have but I feel I'm missing something simple in the
formula...

!Syntax Error, !


{=IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+tx tEC7)(OPNet-OPMet),(OPNet-OPMet)
,{

IF((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5+txtEC6+txtE C7)(DedNet-DedMet),((txtEC1+txtE
C2+txtEC3+

txtEC4+txtEC5+txtEC6+txtEC7)-(DedNet-DedMet))-(((txtEC1+txtEC2+txtEC3+txtEC4+txtEC5
+txtEC6+txtEC7)-(DedNet-DedMet))*NetPer)+(DedNet-DedMet),(txtEC1+txtEC2+txtEC3+txtE
C4+txtEC5+txtEC6+txtEC7)
}) }



Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :-)


  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default IF statement problem !Syntax Error, !

Hi Jlawson,

Ok, i got the formula to work but it gives me error messages when i
have the REF form field blank or in a dollar amount. Is there a way
around this?

Well, for the blank form field you could set a default value of 0. And
you could try setting the FORMAT property to "0" or "0.00" so that
dollar signs (or any other kind of text) won't be allowed.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

  #8   Report Post  
Posted to microsoft.public.word.docmanagement
jlawson jlawson is offline
external usenet poster
 
Posts: 25
Default IF statement problem !Syntax Error, !

OK Cindy, thank you so much for all your help!


Cindy M -WordMVP- wrote:
Hi Jlawson,

Ok, i got the formula to work but it gives me error messages when i
have the REF form field blank or in a dollar amount. Is there a way
around this?

Well, for the blank form field you could set a default value of 0. And
you could try setting the FORMAT property to "0" or "0.00" so that
dollar signs (or any other kind of text) won't be allowed.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)


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
Visual basic runtime error 5216, there is a printer error pat@stlukeshospital Microsoft Word Help 2 June 6th 18 08:53 PM
Odd Mail Merge error Rhino New Users 0 June 17th 06 04:35 PM
Word mail merge error Fraggle257 Microsoft Word Help 1 January 16th 06 07:01 PM
Access word mail merge error Fraggle257 Mailmerge 5 January 16th 06 06:47 PM
I get an error message about a problem with Microsoft Word Michele Blackford Microsoft Word Help 1 August 10th 05 01:45 AM


All times are GMT +1. The time now is 09:19 PM.

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"