View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Text Form Field Calculation

Hi John,

Since you're dealing with formfields, I take it that you mean the unused ones are simply left with the default 5 spaces. I'm
assuming also that a '0' value might actually be a valid number for averaging. In that case, you'll have to code a formula field
something with along the lines of:
{=({IF{Field1}= " " 0 {Field1}}+{IF{Field2}= " " 0 {Field2}}
+{IF{Field3}= " " 0 {Field3}}+{IF{Field4}= " " 0 {Field4}}
+{IF{Field5}= " " 0 {Field5}}+{IF{Field6}= " " 0 {Field6}}
+{IF{Field7}= " " 0 {Field7}}+{IF{Field8}= " " 0 {Field8}}
+{IF{Field9}= " " 0 {Field9}}+{IF{Field10}= " " 0 {Field10}})
/({IF{Field1}= " " 0 1}+{IF{Field2}= " " 0 1}+
{IF{Field3}= " " 0 1}+{IF{Field4}= " " 0 1}+
{IF{Field5}= " " 0 1}+{IF{Field6}= " " 0 1}+
{IF{Field7}= " " 0 1}+{IF{Field8}= " " 0 1}+
{IF{Field9}= " " 0 1}+{IF{Field10}= " " 0 1})}

Cheers

--
macropod
[MVP - Microsoft Word]


"JohnS" wrote in message ...
| I've got 10 Text Form Fields that are all named. I want to average the
| numbers that are entered into those fields. The only problem is that not all
| fields are used every time. I've tried this two ways and neither seems to
| work.
|
| The first is "=average(field1, field2, etc.)". This only works if all
| fields are used.
|
| The second way is to sum the results of the fields, then divide that by a
| count of the fields in use. To get the count of the fields in use I used a
| separate field for each that calculates "=(if, field11,1,0)", then I sum all
| those up to get the number. I can get the sum and the count to work, but
| when I divide the sum by the count it doesn't work.
|
| Any ideas?