#1   Report Post  
Posted to microsoft.public.word.docmanagement
Miranda
 
Posts: n/a
Default text in formula field

Is it possible to write a formula with text strings as the arguments instead
of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or "AUD".
I want to set up a formula in a field such that if the dropdown box says
"USD" then the formula field will also return "USD" and vice versa.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default text in formula field

You can't calculate letters, but you can calculate based on the result of a
form field that contains letters. Use the dropdown field's bookmark in the
calculation. The bookmark will contain the selected content of the field.

Therefore consider a form with two fields Text1 and Dropdown1 and you wish
to multiply Text1 with a figure that relates to the content of Dropdown1.
Insert a Word formula field in the document where you want the result of the
calculation and check the calculate on exit button of both fields (ignore
the any error you get when tabbing out of the first fields if the Text1
field does not yet have content, or set a default value for that field of 0
so that it does)

{ =({ IF{ Dropdown1 } = "AUD" "1" "{ IF{ Dropdown1 } = "USD" "2" }" } *
{Text1 }) }

Here the calculation sets a value of 1 for AUD and 2 for USD. If the value
of AUD and USD are defined elsewhere in the form you can put the form field
names (check their calculate on exit check boxes) in place of the numbers
thus:

{ =({ IF{ Dropdown1 } = "{AUDfieldname}" "1" "{ IF{ Dropdown1 } = "USD"
"{USDfieldname}" }" } * {Text1 }) }

All field boundaries {} are inserted with CTRL+F9. See
http://www.gmayor.com/formatting_word_fields.htm and
http://www.gmayor.com/SelectFile.htm for other examples.

--

Graham Mayor - Word MVP

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



Miranda wrote:
Is it possible to write a formula with text strings as the arguments
instead of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or
"AUD". I want to set up a formula in a field such that if the
dropdown box says "USD" then the formula field will also return "USD"
and vice versa.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Anne Troy
 
Posts: n/a
Default text in formula field

I would simply create a cross-reference to that bookmark.
http://www.officearticles.com/word/c...oft_word .htm

If that's not what you wanted, Excel uses & to concatenate to cells, so I
suspect using an & followed by the bookmark name of your currency type field
would work, but I didn't test it.

************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Miranda" wrote in message
...
Is it possible to write a formula with text strings as the arguments
instead
of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or
"AUD".
I want to set up a formula in a field such that if the dropdown box says
"USD" then the formula field will also return "USD" and vice versa.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default text in formula field

Oops that second example isn't quite right
It should have read:
{ =({ IF{ Dropdown1 } = "AUD" "{AUDfieldname}" "{ IF{ Dropdown1 } =
"USD" "{USDfieldname}" }" } * {Text1 }) }

--

Graham Mayor - Word MVP

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


Graham Mayor wrote:
You can't calculate letters, but you can calculate based on the
result of a form field that contains letters. Use the dropdown
field's bookmark in the calculation. The bookmark will contain the
selected content of the field.
Therefore consider a form with two fields Text1 and Dropdown1 and you
wish to multiply Text1 with a figure that relates to the content of
Dropdown1. Insert a Word formula field in the document where you want
the result of the calculation and check the calculate on exit button
of both fields (ignore the any error you get when tabbing out of the
first fields if the Text1 field does not yet have content, or set a
default value for that field of 0 so that it does)

{ =({ IF{ Dropdown1 } = "AUD" "1" "{ IF{ Dropdown1 } = "USD" "2" }" }
* {Text1 }) }

Here the calculation sets a value of 1 for AUD and 2 for USD. If the
value of AUD and USD are defined elsewhere in the form you can put
the form field names (check their calculate on exit check boxes) in
place of the numbers thus:

{ =({ IF{ Dropdown1 } = "{AUDfieldname}" "1" "{ IF{ Dropdown1 } =
"USD" "{USDfieldname}" }" } * {Text1 }) }

All field boundaries {} are inserted with CTRL+F9. See
http://www.gmayor.com/formatting_word_fields.htm and
http://www.gmayor.com/SelectFile.htm for other examples.


Miranda wrote:
Is it possible to write a formula with text strings as the arguments
instead of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or
"AUD". I want to set up a formula in a field such that if the
dropdown box says "USD" then the formula field will also return "USD"
and vice versa.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Miranda
 
Posts: n/a
Default text in formula field

Dear Anne,

Thank you for the info on cross-referencing... that is very handy. Is it
possible to create a cross-reference to a bookmark? I can't seem to find a
way to do this. I want the reference to change when the dropdown menu is
changed.

"Anne Troy" wrote:

I would simply create a cross-reference to that bookmark.
http://www.officearticles.com/word/c...oft_word .htm

If that's not what you wanted, Excel uses & to concatenate to cells, so I
suspect using an & followed by the bookmark name of your currency type field
would work, but I didn't test it.

************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Miranda" wrote in message
...
Is it possible to write a formula with text strings as the arguments
instead
of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or
"AUD".
I want to set up a formula in a field such that if the dropdown box says
"USD" then the formula field will also return "USD" and vice versa.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default text in formula field

You can cross reference to any bookmark by using a REF field thus {REF
Bookmarkname} or simply {Bookmarkname} - see the examples I quoted earlier.

--

Graham Mayor - Word MVP

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


Miranda wrote:
Dear Anne,

Thank you for the info on cross-referencing... that is very handy. Is
it possible to create a cross-reference to a bookmark? I can't seem
to find a way to do this. I want the reference to change when the
dropdown menu is changed.

"Anne Troy" wrote:

I would simply create a cross-reference to that bookmark.
http://www.officearticles.com/word/c...oft_word .htm

If that's not what you wanted, Excel uses & to concatenate to cells,
so I suspect using an & followed by the bookmark name of your
currency type field would work, but I didn't test it.

************
Hope it helps!
Anne Troy
www.OfficeArticles.com
Check out the NEWsgroup stats!
Check out: www.ExcelUserConference.com

"Miranda" wrote in message
...
Is it possible to write a formula with text strings as the arguments
instead
of numbers?

I am making a form. There is a dropdown box with 2 options: "USD" or
"AUD".
I want to set up a formula in a field such that if the dropdown box
says "USD" then the formula field will also return "USD" and vice
versa.



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 applies direct format on File open Uriel Microsoft Word Help 16 November 27th 05 07:22 PM
cross reference field with space and colored text Hilary Microsoft Word Help 2 November 2nd 05 09:42 PM
Enter data in 1 text form field & have multiple locations fill Lee Microsoft Word Help 1 March 16th 05 10:56 PM
help, problem with text field in word 2003 Salvatore Microsoft Word Help 1 January 21st 05 03:40 PM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM


All times are GMT +1. The time now is 06:09 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"