Calculations in a template

E

Evon

I am working with a Word template where a table updates numbers in a table from a Lotus Notes program. I want a total of all of the cells to fill in a blank outside of the table. Is this possible?
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Select the Table in the template and assign a bookmark name to it (e.g.
Table1). Then where you want the total to appear use the following field
construction

{ = Sum( Table1 A1:A4) }

that would give the sum of the first four rows in the first column of the
table.

You need to update the fields in the document for the result to be display.
That can be done with code, but then you might just as well have the code
that is populating the cells, also populate the .Range of the location where
you want the total to appear with the total determined by the code.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
C

Charles Kenyon

When your merge fills in the document, are there any cells that are blank or
have non-numeric data included in the calculation?
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

Evon said:
Doug,
Thanks it works in the template, but the template is linked to a Lotus
Notes Database and when it comes up the field is filled with a "0" only.
Any ideas why it works on the template but not on the final document?
 
C

Charles Kenyon

At least some implementations of = Sum() do not treat blank cells as 0 but
rather use a blank cell as a boundary for the calculation. I've found the
only way I get table math to work is to either 0 blank cells or refer to
specific cells rather than a range. A1 + A2 + A3 instead of sum(A1:A3).
Otherwise, use Excel as an intermediate step.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
S

Suzanne S. Barnhill

Sum with a range should work; it's Sum(Above) that stops at blank cells.
 
E

Evon,

Charles
Thanks for your help. Unfortunatley, I am unable to predict which cells will have numbers filled. I'm afraid it will be a Lotus Notes developer question. Know anyone in So. Cal. with Lotus Notes skills? We need someone
Evon
 
E

Evon

Suzanne
The formula I used referenced a bookmark (highlighted entire table) and then =sum (bookmark name A1:e5). It works OK in the template but not in the end document
Evon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top