IF statement using numerical expression with a text result

C

covingj

I am trying to create a IF statement that will test a numerical expression
that will result in a text string. Of course I can get this to work in Excel,
but when I put the Excel object into a Word document, it gets ugly when you
go to use it. With my end users, the page can't be changing or they freak out.

Anyway, the statement I'm trying to create in the table would be like so:

=IF (High < 540, "Pass", "Fail")

High is a named text field where the user enters a monetary value which is
then tested to determine if the result is pass/fail.

Any help would be greatly appreciated.
 
C

covingj

Thank you, I believe I got it to work. Unfortunately I am still having
difficulty with IF statements in the project I'm working on. I referred to
the document linked in the reply, and have tried to figure out what I am
trying to do, but I keep getting the same errors. In the document it says
that AND functions do not work for text strings, but you can approximate the
function with IF statements. I followed the instructions, but keep getting:
Error! Unknown op code for conditional. I'm sure I'm overlooking an obvious
error.

I have three criteria that have been tested with Pass/Fail results. I now
want to test so that if the person passes all three criteria, then they are
referred. If they fail any of the three criteria, then they are not referred.
The three criteria are bookmarked as Crit_1, Crit_2, and Crit_3. I am using
text form fields to gather the original data but I am not using a form field
for the calculations. The formula I created is as follows:

{ IF { IF { Crit_1 }= “Pass†1 0 } * { IF { Crit_2 }= “Pass†1 0 } * { IF {
Crit_3 }= “Pass†1 0 }=1 “Refer†“Do Not Referâ€}

The { } was created using Crtl-F9.

Once again thank you for any help that may be provided.


macropod said:
Hi covingj,

Press Ctrl-F9 twice to create a pair of nested field braces (ie '{ { } }'), then fill in the space between them so that you end up
with:
{IF{High}< 540 "Pass" "Fail")}

For more information on this and a wide range of other calculations in Word, 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


--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
I am trying to create a IF statement that will test a numerical expression
that will result in a text string. Of course I can get this to work in Excel,
but when I put the Excel object into a Word document, it gets ugly when you
go to use it. With my end users, the page can't be changing or they freak out.

Anyway, the statement I'm trying to create in the table would be like so:

=IF (High < 540, "Pass", "Fail")

High is a named text field where the user enters a monetary value which is
then tested to determine if the result is pass/fail.

Any help would be greatly appreciated.
 
M

macropod

Hi covingj,

Your last '}=1' needs a space - it should be '}= 1'.

You can also delete a number of extraneous spaces, as in:
{IF{IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1 0}= 1 "Refer" "Do Not Refer"}

--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
Thank you, I believe I got it to work. Unfortunately I am still having
difficulty with IF statements in the project I'm working on. I referred to
the document linked in the reply, and have tried to figure out what I am
trying to do, but I keep getting the same errors. In the document it says
that AND functions do not work for text strings, but you can approximate the
function with IF statements. I followed the instructions, but keep getting:
Error! Unknown op code for conditional. I'm sure I'm overlooking an obvious
error.

I have three criteria that have been tested with Pass/Fail results. I now
want to test so that if the person passes all three criteria, then they are
referred. If they fail any of the three criteria, then they are not referred.
The three criteria are bookmarked as Crit_1, Crit_2, and Crit_3. I am using
text form fields to gather the original data but I am not using a form field
for the calculations. The formula I created is as follows:

{ IF { IF { Crit_1 }= “Pass†1 0 } * { IF { Crit_2 }= “Pass†1 0 } * { IF {
Crit_3 }= “Pass†1 0 }=1 “Refer†“Do Not Referâ€}

The { } was created using Crtl-F9.

Once again thank you for any help that may be provided.


macropod said:
Hi covingj,

Press Ctrl-F9 twice to create a pair of nested field braces (ie '{ { } }'), then fill in the space between them so that you end
up
with:
{IF{High}< 540 "Pass" "Fail")}

For more information on this and a wide range of other calculations in Word, 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


--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
I am trying to create a IF statement that will test a numerical expression
that will result in a text string. Of course I can get this to work in Excel,
but when I put the Excel object into a Word document, it gets ugly when you
go to use it. With my end users, the page can't be changing or they freak out.

Anyway, the statement I'm trying to create in the table would be like so:

=IF (High < 540, "Pass", "Fail")

High is a named text field where the user enters a monetary value which is
then tested to determine if the result is pass/fail.

Any help would be greatly appreciated.
 
C

covingj

Thanks again. I still can't get it to work. I toggled through the codes, and
it looked like it was only solving the IF statement for Crit_1. I enclosed
the IF statements for the three criteria in parenthesis, and then it solved
all three IFs. It appears to stop at that point and not solve the overall IF
statement. I may just give up and stay with the ugly Excel object solution. I
am including the latest version of the formula just in case you have any last
ideas because I'm stubborn and it bugs me that this isn't working.

{IF({IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1
0})= 1 "Refer" "Do Not Refer"}

It solves down to this point:

{IF(1*1*1)= 1 "Refer" "Do Not Refer"}

Thanks again.

macropod said:
Hi covingj,

Your last '}=1' needs a space - it should be '}= 1'.

You can also delete a number of extraneous spaces, as in:
{IF{IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1 0}= 1 "Refer" "Do Not Refer"}

--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
Thank you, I believe I got it to work. Unfortunately I am still having
difficulty with IF statements in the project I'm working on. I referred to
the document linked in the reply, and have tried to figure out what I am
trying to do, but I keep getting the same errors. In the document it says
that AND functions do not work for text strings, but you can approximate the
function with IF statements. I followed the instructions, but keep getting:
Error! Unknown op code for conditional. I'm sure I'm overlooking an obvious
error.

I have three criteria that have been tested with Pass/Fail results. I now
want to test so that if the person passes all three criteria, then they are
referred. If they fail any of the three criteria, then they are not referred.
The three criteria are bookmarked as Crit_1, Crit_2, and Crit_3. I am using
text form fields to gather the original data but I am not using a form field
for the calculations. The formula I created is as follows:

{ IF { IF { Crit_1 }= “Pass†1 0 } * { IF { Crit_2 }= “Pass†1 0 } * { IF {
Crit_3 }= “Pass†1 0 }=1 “Refer†“Do Not Referâ€}

The { } was created using Crtl-F9.

Once again thank you for any help that may be provided.


macropod said:
Hi covingj,

Press Ctrl-F9 twice to create a pair of nested field braces (ie '{ { } }'), then fill in the space between them so that you end
up
with:
{IF{High}< 540 "Pass" "Fail")}

For more information on this and a wide range of other calculations in Word, 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


--
Cheers
macropod
[MVP - Microsoft Word]


I am trying to create a IF statement that will test a numerical expression
that will result in a text string. Of course I can get this to work in Excel,
but when I put the Excel object into a Word document, it gets ugly when you
go to use it. With my end users, the page can't be changing or they freak out.

Anyway, the statement I'm trying to create in the table would be like so:

=IF (High < 540, "Pass", "Fail")

High is a named text field where the user enters a monetary value which is
then tested to determine if the result is pass/fail.

Any help would be greatly appreciated.
 
M

macropod

Hi covingj,

Try:
{IF{={IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1 0}}= 1 "Refer" "Do Not Refer"}


--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
Thanks again. I still can't get it to work. I toggled through the codes, and
it looked like it was only solving the IF statement for Crit_1. I enclosed
the IF statements for the three criteria in parenthesis, and then it solved
all three IFs. It appears to stop at that point and not solve the overall IF
statement. I may just give up and stay with the ugly Excel object solution. I
am including the latest version of the formula just in case you have any last
ideas because I'm stubborn and it bugs me that this isn't working.

{IF({IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1
0})= 1 "Refer" "Do Not Refer"}

It solves down to this point:

{IF(1*1*1)= 1 "Refer" "Do Not Refer"}

Thanks again.

macropod said:
Hi covingj,

Your last '}=1' needs a space - it should be '}= 1'.

You can also delete a number of extraneous spaces, as in:
{IF{IF{Crit_1}= "Pass" 1 0}*{IF{Crit_2}= "Pass" 1 0}*{IF{Crit_3}= "Pass" 1 0}= 1 "Refer" "Do Not Refer"}

--
Cheers
macropod
[MVP - Microsoft Word]


covingj said:
Thank you, I believe I got it to work. Unfortunately I am still having
difficulty with IF statements in the project I'm working on. I referred to
the document linked in the reply, and have tried to figure out what I am
trying to do, but I keep getting the same errors. In the document it says
that AND functions do not work for text strings, but you can approximate the
function with IF statements. I followed the instructions, but keep getting:
Error! Unknown op code for conditional. I'm sure I'm overlooking an obvious
error.

I have three criteria that have been tested with Pass/Fail results. I now
want to test so that if the person passes all three criteria, then they are
referred. If they fail any of the three criteria, then they are not referred.
The three criteria are bookmarked as Crit_1, Crit_2, and Crit_3. I am using
text form fields to gather the original data but I am not using a form field
for the calculations. The formula I created is as follows:

{ IF { IF { Crit_1 }= “Pass†1 0 } * { IF { Crit_2 }= “Pass†1 0 } * { IF {
Crit_3 }= “Pass†1 0 }=1 “Refer†“Do Not Referâ€}

The { } was created using Crtl-F9.

Once again thank you for any help that may be provided.


:

Hi covingj,

Press Ctrl-F9 twice to create a pair of nested field braces (ie '{ { } }'), then fill in the space between them so that you
end
up
with:
{IF{High}< 540 "Pass" "Fail")}

For more information on this and a wide range of other calculations in Word, 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


--
Cheers
macropod
[MVP - Microsoft Word]


I am trying to create a IF statement that will test a numerical expression
that will result in a text string. Of course I can get this to work in Excel,
but when I put the Excel object into a Word document, it gets ugly when you
go to use it. With my end users, the page can't be changing or they freak out.

Anyway, the statement I'm trying to create in the table would be like so:

=IF (High < 540, "Pass", "Fail")

High is a named text field where the user enters a monetary value which is
then tested to determine if the result is pass/fail.

Any help would be greatly appreciated.
 
C

covingj

Thank you for your patience. This worked just like I wanted it to. You have
been very helpful
 

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