# Thread: Calculating drop-down menu values (Word 2000)

1. ## Calculating drop-down menu values (Word 2000)

Does anyone know how to perform a calculation using numbers that are chosen from a drop-down menu (numbers 1 thru 5 appear in a list of drop down menus and need to be averaged)?

2. ## Re: Calculating drop-down menu values (Word 2000)

Thanks Phil! The only problem is that the curly brackets are giving me a syntax error. Any idea why? I've chosen "calculate on exit" on each of the dropdown menus. I've bookmarked the dropdown menus - dropdown1, dropdown2 and dropdown3 and I've inserted the formula... =({dropdown1}+{dropdown2}+{dropdown3})/3 ... in the field where the average needs to appear. I've locked the form. What am I doing wrong? Thanks so much for your help.

3. ## Re: Calculating drop-down menu values (Word 2000)

I did it Phil! I was missing the CONTROL key before the f9 key. And I was trying to put it into a formula field which didn't work. But once I put the formula into a regular field - voila. Thanks so much!

4. ## Re: Calculating drop-down menu values (Word 2000)

<P ID="edit" class=small>Edited by Phil Rabichow on 30-May-02 18:10.</P>Hi Sherry:
1. In your dropdown fields, make sure you go to Properties & tick "calculate on exit".
2. Use the following type of formula field:
{ =({ ref dropdown1 }+{ ref dropdown2 })/2 }

i.e. Use an = field, where the curly braces are inserted with Ctrl+F9. Make sure that you enclose the ref fields that refer to the fields that you need to average with a parenthesis & divide by the number of fields. Then lock your form.

Cheers,

5. ## Re: Calculating drop-down menu values (Word 2000)

You're welcome, Sherry. I'm sorry for the typo--fingers faster than brain; the curly brackets are inserted with Ctrl+F9 & I've edited the original post to correct that.

Cheers,

6. ## Re: Calculating drop-down menu values (Word 2000)

Phil: This post caught my attention, and I've tried to follow your instructions. Sadly, I'm getting a syntax error myself. I've used Word for years, but this inserting fields stuff is pretty new to me. Here's what I've done.

I used the forms toolbar to insert four dropdown fields, each with the numbers 1 thru 5 in the list. Then I hit Enter a coupla times and pressed Ctrl+F9 to create a blank field. Then I keyed in exactly what you gave in your answer to SherryThing. The first time I tried this, I used Ctrl+F9 to create the first set of curly brackets, but I just keyed in the curly brackets that surround the text "ref dropdown1" and so on. When I got the syntax error, I went back and pressed Ctrl+F9 to insert ALL the curly brackets. My formula looks just like yours, but I still get the syntax error. What am I missing?

I suspect there are some things that you and SherryThing understand about this process...basic stuff that I don't understand and that I'm leaving out. I appreciate the help.

7. ## Re: Calculating drop-down menu values (Word 2000)

In my experience, creating nested fields is tricky. Sometimes, a field will not be recognized because of a typo. Correcting the typo doesn't always work, although it should. So, when I mess things up, I usually delete everything and start over form scratch.

I have attached a word doc with 4 dropdown fields and a calculated average.
It is protected for forms, so you can select numbers from the dropdown lists and see what happens.
Unprotect the doc if you want to see the field codes.

8. ## Re: Calculating drop-down menu values (Word 2000)

Thanks, Hans! You are very kind to post that sample document.

Your example looks very simple, and it works! Funny thing is, except for some small details, yours looks just like the one I wrote. I'll bet you're right: if I'd just dumped everything and started over, mine would have worked, too.

9. ## Re: Calculating drop-down menu values (Word 2000)

Hi Lucas:
I'm not sure what you did wrong, but I see Hans has given you the syntax. If you want to either post the syntax that you used or upload the document, I'll take a look at it. (Or Hans will because he's probably faster than me) <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

10. ## Re: Calculating drop-down menu values (Word 2000)

Thanks, Phil--I THINK I've got what I need. Hans seems to have identified the problem, i.e., that fixing a typo doesn't always nor necessarily fix the problem.

11. ## Re: Calculating drop-down menu values (Word 2000)

OK. But remember, when you find & correct a typo, you still have to select & update the fields.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•