Conditional Formula in Word?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table in word form and I'd like to enter the contents of a
particular cell into one of two other cells depending on whether an "X" has
been entered in one of another two cells.

Basically, there are two possible destination cells (A12 or B12).
In Excel, I would have put IF(J1="X",L6,"") into A12, and IF(K1="X",L6,"")
into B12

In other words, the user of the form will enter an X into either J1 or K1.
If the X is entered in J1 then I want the contents of L6 to be placed into
A12.
If the X is entered in K1 then I want the contents of L6 to be placed into
B12.

I tried the same formula as I would have used in Excel but it didn't work.
Can this be done in word??

Many thanks
 
Hi Mercedes,

Yes, it can be done, but not with cell addressing like you'd use in Excel. That's because you're wanting to test a character and
Word's table formulae only work with ordinary numbers (not even dates). Since you're using a form, I take it that you're also using
formfields. In that case, set the formfields up with appropriate bookmarks and the 'calculate on exit' property. Then use formula
fields to test the bookmarks and output the appropriate values.

For more information on cell referencing, formulae and 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
 
Okay, I bookmarked the formfields in the two cells in which the user should
place an “X†as “bkX1†and “bkX2†and in the destination cells I tried your
suggestion of:
{IF{BkMrk}= "True Text" "BkMrk is True Text" "BkMrk is not True Text"}
Translated for my case, it turned out like so: {IF{bkX1}= “X†L9 “â€} and
returned nothing.
I then tried entering it through the INSERT > FIELD option using the IF
Field name and using the “=(Formula)†but still nothing.
Using the “=(Formula)†option returned “L9†when I put an X in the origin
cell rather than returning the contents of cell L9.
Moreover, each time I go back to it, I have a “\* MERGEFORMAT†tagged onto
the end.
Now it looks like this:
IF bkX1 = X L9 0 \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT

I know I probably have the syntax all wrong… I’m no good with formulas in
word!
Can you tell me what I’m doing wrong??
Thanks so much.


macropod said:
Hi Mercedes,

Yes, it can be done, but not with cell addressing like you'd use in Excel. That's because you're wanting to test a character and
Word's table formulae only work with ordinary numbers (not even dates). Since you're using a form, I take it that you're also using
formfields. In that case, set the formfields up with appropriate bookmarks and the 'calculate on exit' property. Then use formula
fields to test the bookmarks and output the appropriate values.

For more information on cell referencing, formulae and 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]
-------------------------

Mercedes.K said:
I have a table in word form and I'd like to enter the contents of a
particular cell into one of two other cells depending on whether an "X" has
been entered in one of another two cells.

Basically, there are two possible destination cells (A12 or B12).
In Excel, I would have put IF(J1="X",L6,"") into A12, and IF(K1="X",L6,"")
into B12

In other words, the user of the form will enter an X into either J1 or K1.
If the X is entered in J1 then I want the contents of L6 to be placed into
A12.
If the X is entered in K1 then I want the contents of L6 to be placed into
B12.

I tried the same formula as I would have used in Excel but it didn't work.
Can this be done in word??

Many thanks
 
Hi Mercedes,

Assuming cell L9 holds a number, code the field as:
{IF{bkX1}= "X" {=L9}}
where all the field braces (ie '{ }') are created in pairs via Ctrl-F9.

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

Mercedes.K said:
Okay, I bookmarked the formfields in the two cells in which the user should
place an “X†as “bkX1†and “bkX2†and in the destination cells I tried your
suggestion of:
{IF{BkMrk}= "True Text" "BkMrk is True Text" "BkMrk is not True Text"}
Translated for my case, it turned out like so: {IF{bkX1}= “X†L9 “â€} and
returned nothing.
I then tried entering it through the INSERT > FIELD option using the IF
Field name and using the “=(Formula)†but still nothing.
Using the “=(Formula)†option returned “L9†when I put an X in the origin
cell rather than returning the contents of cell L9.
Moreover, each time I go back to it, I have a “\* MERGEFORMAT†tagged onto
the end.
Now it looks like this:
IF bkX1 = X L9 0 \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT

I know I probably have the syntax all wrong… I’m no good with formulas in
word!
Can you tell me what I’m doing wrong??
Thanks so much.


macropod said:
Hi Mercedes,

Yes, it can be done, but not with cell addressing like you'd use in Excel. That's because you're wanting to test a character and
Word's table formulae only work with ordinary numbers (not even dates). Since you're using a form, I take it that you're also
using
formfields. In that case, set the formfields up with appropriate bookmarks and the 'calculate on exit' property. Then use formula
fields to test the bookmarks and output the appropriate values.

For more information on cell referencing, formulae and 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]
-------------------------

Mercedes.K said:
I have a table in word form and I'd like to enter the contents of a
particular cell into one of two other cells depending on whether an "X" has
been entered in one of another two cells.

Basically, there are two possible destination cells (A12 or B12).
In Excel, I would have put IF(J1="X",L6,"") into A12, and IF(K1="X",L6,"")
into B12

In other words, the user of the form will enter an X into either J1 or K1.
If the X is entered in J1 then I want the contents of L6 to be placed into
A12.
If the X is entered in K1 then I want the contents of L6 to be placed into
B12.

I tried the same formula as I would have used in Excel but it didn't work.
Can this be done in word??

Many thanks
 
In addition to what macropod has said, note that it is not necessary to
apply a bookmark manually to form fields; they all have built-in bookmarks
(which work much better than manually applied ones). In the Form Field
Options dialog, you'll see the bookmark name, which you can change to
anything you like. Possibly this is what you have already done, but your
statement that you "bookmarked the formfields" led me to suspect that you
might have used Insert | Bookmark instead.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Mercedes.K said:
Okay, I bookmarked the formfields in the two cells in which the user should
place an “X†as “bkX1†and “bkX2†and in the destination cells I tried your
suggestion of:
{IF{BkMrk}= "True Text" "BkMrk is True Text" "BkMrk is not True Text"}
Translated for my case, it turned out like so: {IF{bkX1}= “X†L9 “â€} and
returned nothing.
I then tried entering it through the INSERT > FIELD option using the IF
Field name and using the “=(Formula)†but still nothing.
Using the “=(Formula)†option returned “L9†when I put an X in the origin
cell rather than returning the contents of cell L9.
Moreover, each time I go back to it, I have a “\* MERGEFORMAT†tagged onto
the end.
Now it looks like this:
IF bkX1 = X L9 0 \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT

I know I probably have the syntax all wrong… I’m no good with formulas in
word!
Can you tell me what I’m doing wrong??
Thanks so much.


macropod said:
Hi Mercedes,

Yes, it can be done, but not with cell addressing like you'd use in Excel. That's because you're wanting to test a character and
Word's table formulae only work with ordinary numbers (not even dates). Since you're using a form, I take it that you're also using
formfields. In that case, set the formfields up with appropriate bookmarks and the 'calculate on exit' property. Then use formula
fields to test the bookmarks and output the appropriate values.

For more information on cell referencing, formulae and 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 have a table in word form and I'd like to enter the contents of a
particular cell into one of two other cells depending on whether an "X" has
been entered in one of another two cells.

Basically, there are two possible destination cells (A12 or B12).
In Excel, I would have put IF(J1="X",L6,"") into A12, and IF(K1="X",L6,"")
into B12

In other words, the user of the form will enter an X into either J1 or K1.
If the X is entered in J1 then I want the contents of L6 to be placed into
A12.
If the X is entered in K1 then I want the contents of L6 to be placed into
B12.

I tried the same formula as I would have used in Excel but it didn't work.
Can this be done in word??

Many thanks
 
Thank you so VERY much. Truly appreciated.

macropod said:
Hi Mercedes,

Assuming cell L9 holds a number, code the field as:
{IF{bkX1}= "X" {=L9}}
where all the field braces (ie '{ }') are created in pairs via Ctrl-F9.

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

Mercedes.K said:
Okay, I bookmarked the formfields in the two cells in which the user should
place an “X†as “bkX1†and “bkX2†and in the destination cells I tried your
suggestion of:
{IF{BkMrk}= "True Text" "BkMrk is True Text" "BkMrk is not True Text"}
Translated for my case, it turned out like so: {IF{bkX1}= “X†L9 “â€} and
returned nothing.
I then tried entering it through the INSERT > FIELD option using the IF
Field name and using the “=(Formula)†but still nothing.
Using the “=(Formula)†option returned “L9†when I put an X in the origin
cell rather than returning the contents of cell L9.
Moreover, each time I go back to it, I have a “\* MERGEFORMAT†tagged onto
the end.
Now it looks like this:
IF bkX1 = X L9 0 \* MERGEFORMAT \* MERGEFORMAT \* MERGEFORMAT

I know I probably have the syntax all wrong… I’m no good with formulas in
word!
Can you tell me what I’m doing wrong??
Thanks so much.


macropod said:
Hi Mercedes,

Yes, it can be done, but not with cell addressing like you'd use in Excel. That's because you're wanting to test a character and
Word's table formulae only work with ordinary numbers (not even dates). Since you're using a form, I take it that you're also
using
formfields. In that case, set the formfields up with appropriate bookmarks and the 'calculate on exit' property. Then use formula
fields to test the bookmarks and output the appropriate values.

For more information on cell referencing, formulae and 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 have a table in word form and I'd like to enter the contents of a
particular cell into one of two other cells depending on whether an "X" has
been entered in one of another two cells.

Basically, there are two possible destination cells (A12 or B12).
In Excel, I would have put IF(J1="X",L6,"") into A12, and IF(K1="X",L6,"")
into B12

In other words, the user of the form will enter an X into either J1 or K1.
If the X is entered in J1 then I want the contents of L6 to be placed into
A12.
If the X is entered in K1 then I want the contents of L6 to be placed into
B12.

I tried the same formula as I would have used in Excel but it didn't work.
Can this be done in word??

Many thanks
 
Back
Top