Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSWORD BOOKMARKS

Status
Not open for further replies.

a228380

MIS
May 21, 2004
24
US
i have a word documents that has 7 book marks and in bookmark8 I would like to display the average of the value of the 7 books marks but can not determine the syntax I need to make this occur. the 8th bookmark does not have to be a bookmark it can just be a field

 
This formula works:

= (Bookmark1 + Bookmark2 + Bookmark3 + Bookmark4 + Bookmark5 + Bookmark6 + Bookmark7)/7

 
Sorry, I forgot to add this statement
Change your field type to "Calculation" and enter the formula that I mentioned above in the "Expression" field.
 
I can not seem to locate where you do this. in msword, I did insert field but I can not locate calculation as a type can you elaborate?
 
I want to make sure we are on the same page. You are inserting a text field from the Controls group on the Developer tab, correct?

If you are, then you can double click on the field that you added or right click and choose properties. It will open up the Field Options dialog box. From that dialog box you should be able to change it from text to calculation and enter your expression.
 
There is an AVERAGE formula you can use.

* Insert > Field
* Under Field Names, "=(Formula)" is at the top of the list and should be preselected - if not, try selecting Equations and Formulas from the Categories list above it
* When you have =(Formula) selected, you will have a Formula button on the right - click on it to bring up the formula dialogue
* Click on the dropdown arrow under Paste Function and select AVERAGE
* Between the parentheses in the Formula box, enter your bookmark names separated by commas (or semicolons depending on your regional settings)



Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Hi tony

yes we are on the same page, I always get zero even though my bookmarks have values. If I do REF (dropdown1) which is the name of my book mark it will display the value 2 which is what the user entered for bookmark 2. but when I sum them or average them I always get zero as if it is not calculating the value of the bookmark.

I tried =average(dropdown1, dropdown2,dropdown3...dropdown7)

I can =ref(dropdown1) and get the value of dropdown1

If i try =average(ref(dropdown1),ref(dropdown2)...ref(dropdown7)) I get a syntax error
 
Hi a228380,

Try a field coded as:
{=AVERAGE({Dropdown1},{Dropdown2},{Dropdown3},{Dropdown4},{Dropdown5},{Dropdown6},{Dropdown7})}
or:
{=({Dropdown1}+{Dropdown2}+{Dropdown3}+{Dropdown4}+{Dropdown5}+{Dropdown6}+{Dropdown7})/7}
where the field braces (ie '{}') are all created in pairs via Ctrl-F9.

Note that either formula will fail if the dropdown field has non-numeric content.

Cheers

[MS MVP - Word]
 
It would have been better to not refer to them as bookmarks. These are, I take it, formfields. Yes, they have bookmarks, but they are not, themselves, bookmarks.


faq219-2884

Gerry
My paintings and sculpture
 
The problem is that dropdowns are text fields. You will need to coerce them to numbers, something like:

{ =AVERAGE( { Dropdown1 \# 0 }, { Dropdown2 \# 0 } ) }

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
hi tony
I tried all of the suggestions and get syntax error almost all the time. basically the creator of the document wants to limit the choices which is why they probably used bookmarks.
 
If they are real bookmarks then they are NOT, and can not, be dropdowns. If they are dropdowns - as they seem to be, then they are either formfields, OR they are ActiveX comboboxes.

It would really help if you answer questions that people ask you.

abcmsr said:
I want to make sure we are on the same page. You are inserting a text field from the Controls group on the Developer tab, correct?

I do not think you are using Controls, but I suppose it is possible.

I followed EXACTLY what macropod suggested (with formfields) and it works perfectly. With the caveat, as is mentioned, that the items in the dropdowns must be numeric. Or, as Tony mentions, you force them into numeric.

"basically the creator of the document wants to limit the choices which is why they probably used bookmarks."

Frankly, I simply do not believe this, that they are bookmarks. They can not be, if they are dropdowns. Using dropdowns to limit choices is quite valid, but again...they are NOT bookmarks. They are formfields, and formfields have bookmarks. Or not. You can delete the bookmark for a formfield...and the formfield still exists, and can still be used for precisely what you want to do. Average the values. macropod's AVERAGE works exactly as stated. If it does not, you are putting them in incorrectly. Are you using Ctrl-F9 for EACH internal field? If you do not, you will indeed get a syntax error. You also must make sure you enclose the whole thing - EXACTLY as macropod posted - within a bracket.


faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top