Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Subtotals in word tables

729 views
Skip to first unread message

Marco Lattanzio

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
I have a word table which spans on several pages.
Is there a way to insert in the footpage a field which contains the sum of
all the values in a column, only for the values in that page?
And a field which contains the sum of all the values in a column for that
page and all preceding pages?

Thanks in advance.

--

Marco Lattanzio

Doug Robbins

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Hi Marco,

I understand that what you want to do is but the subtotals in the page
footer.

I can be done, but it will not be very dynamic as if something causes a page
break to move, the subtotals will get out of sync.

The other problem is that to have different items appearing in the footer,
you will need either a section break between each page, or you will need to
use some IF field constructions to dictate what is included in the footer.
The problem with the section breaks approach will be that if something
causes the page break to appear in a different position, the table rows will
not "flow" over the section break.

Having said all that, you can get the sum of a range of cells in a table
from outside the table, by selecting the table and assigning a bookmark to
the table and then use the following field construction

{=Sum(Table1 a1:a10)}

using Ctrl+F9 to insert the braces.

That formula will give the sum of cells a1 to a10 in a table to which the
bookmark name Table1 has been assigned.

Now to get different subtotals on each page, you are going to need to use an
{IF} field to compare the page number to the page on which the table
commences. Let's assume that the table commences on page 1 and that there
are 10 rows on each page and that the table spans 3 pages. In the footer
you will need to insert the following field construction:

{if{page} = 1 {=Sum(Table1 a1:a10)} }{if{page} = 2 {=Sum(Table1
1:a20)} }{If{page} = 3 {=sum(Table1 a1:a30)} }

Make sure that you use Ctrl+F9 to insert each pair of {} and also that you
leave a space either side of the = after the {page} field.

Hope this helps.
Regards,
Doug Robbins - Word MVP

To assist in maintaining the thread for the benefit of others, please post
any response to the NewsGroup.


Marco Lattanzio wrote in message
<#H$sK7dG#GA....@uppssnewspub05.moswest.msn.net>...

Terry Farrell

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Marco,

this is a piece of cake for Excel but can be difficult (that's an
understatement!) in Word. First a few questions... does the number of rows
to add remain constant? How many rows need adding? Are any of the rows
empty? Is this Word97? All significant tot he method.

Terry


Marco Lattanzio <ml...@elda.it> wrote in message
news:#H$sK7dG#GA....@uppssnewspub05.moswest.msn.net...

Marco Lattanzio

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Hi,

More information about the problem.
1) The document is a RTF document which could be read with Word95 or Word97,
but if the solution exists only for Word97 it's not a trouble.
2) The number of rows to be added is non constant (THIS is the real
problem...)
3) Some of the rows could be empty, but if this is a problem I can do
something to have only non-empty rows.

Thanks.

Marco Lattanzio

Terry Farrell ha scritto nel messaggio
<#OsapJfG#GA....@uppssnewspub04.moswest.msn.net>...

Doug Robbins

unread,
Nov 28, 1998, 3:00:00 AM11/28/98
to
Hi Marco,

>2) The number of rows to be added is non constant (THIS is the real
>problem...)


But after you set up the footer, are the number of rows that contribute to
any one subtotal likely to change?

If that is the case, you're going to need a macro to set up the fields in
the footer and some of the code required can probably be gleaned from the
Table cell helper macro in Program Files\Microsoft
Office\Office\Macros\Macros8.dot.

I'm afraid as Terry said, Word is not really suited to this.

Doug Robbins


Marco Lattanzio <ml...@elda.it> wrote in message

news:eA0WLdgG#GA....@uppssnewspub05.moswest.msn.net...

0 new messages