Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word applies direct format on File open | Microsoft Word Help | |||
cross reference field with space and colored text | Microsoft Word Help | |||
Enter data in 1 text form field & have multiple locations fill | Microsoft Word Help | |||
help, problem with text field in word 2003 | Microsoft Word Help | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help |