WD2000: Calculation Error When Referencing Bookmark in Table (211238)
The information in this article applies to:
This article was previously published under Q211238 SYMPTOMS
A formula in Word may show an incorrect result if the calculation refers to
a bookmark in a table when the bookmark includes the entire cell.
For example, the following table has two cells, with a bookmark (test1) applied to the first cell:
--------------------
| 4 | 6 |
--------------------
^--test1---^
The sample field below uses a bookmark for multiplication:
The result of the field is 30, but it should be 12.
CAUSE
When you create a bookmark that contains an entire table cell, the bookmark then refers to the entire table rather than the contents of a single cell. As a result, when you use that bookmark as direct reference in a Formula field, the values stored in the table are summed and that sum is then used as the value of the bookmark.
WORKAROUND
To work around this problem, use either of the following methods.
Method 1
Apply the bookmark only to the contents of a cell, not to the entire cell.
This method is best when you expect that the contents of the cells won't
change, or if you only reference one cell from the table.
Method 2
Use the following procedure to refer to individual cells of the table by
applying a bookmark to the entire table. This method is most efficient when
you need to use several cells from the table. To use this method, follow
these steps:
- Place the insertion point somewhere in the table. For example, move the insertion point to cell A1.
- On the Table menu, click Select Table.
- On the Insert menu, click Bookmark.
- Type a name for the bookmark, such as "Table1" (without the quotation
marks).
- Move the insertion point to the place where you want the formula.
- Press CTRL+F9 to type the field brackets, and then type the reference
to the cell in the following format:
{ =SUM(bookmarkname[cellreference]) }
In the above example, the formula would look like this:
To add two cells from the same table, use a formula such as the
following:
{ =SUM(Table1 A1) + SUM(Table1 B1) }
NOTE: A bookmark must be used to identify which table you are referring to if the formula field performing the calculation is not located inside the table being referred to.
For additional information about doing calculations based on tables, please see the following article in the Microsoft Knowledge Base:
211255 WD2000: How to Set Up a Table As a Worksheet in Word
Modification Type: | Major | Last Reviewed: | 12/6/2000 |
---|
Keywords: | kbfield kbprb kbtable KB211238 |
---|
|