View Single Post
  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Calculate results of dropdown boxes in table

Peter
Your solution crossed with my latest revision, which adopts a slightly
different approach

--

Graham Mayor - Word MVP

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



"Peter Jamieson" wrote in message
...
I expect there is a simpler formulation, but I think the following will do
it, assuming the possible values of dropdown1 to 4 are " ", 1, 2, 3.

{ SET c { = { QUOTE "sign(0{ dropdown1 })+sign(0{ dropdown2 }+sign(0{
dropdown3 }+sign(0{ dropdown4 }" } } }{ IF c = 0 "" "{ ={ QUOTE "(0{
dropdown1 }+0{ dropdown2 }+0{ dropdown3 }+0{ dropdown4 })/c" } }" }

The problem with using any of the = field functions like AVERAGE and SUM
is that they require more than one item in the list - i.e. { =SUM(1,2) }
is OK, but {=SUM(1) } and {=SUM(,2) } are not.

By prepending all the dropdown results with "0" we end up with "0 ", "01",
"02", and "04" which can more easily be plugged into {=} field
calculations.


Peter Jamieson

http://tips.pjmsn.me.uk

On 21/04/2010 08:53, Graham Mayor wrote:
If the average is not to include blank fields then it may not be possible
to
do this without using macros - at least I cannot think of a way. However
it
has to be said that mathematics was never my stongest subject and our
resident field expert is away on a trip and may not pop in to this forum
for
a while.