#  Other Applications & Softwares  > Word Formatting & General >  > [SOLVED] Putting a formula into a word table to sum columns

## Gavalar

The document I am making has a table where I have broken down the individual components but I also want to add the totals for 2 columns but the only options are SUM(LEFT) or SUM(ABOVE) however none of these will work with my table (See attachment) I'm reading through the help menu but it's not really helping.

Can anyone assist this will be greatly appreciated

Gav

----------


## macropod

You have a bunch of different fields in that table, some of which I suspect you don't want (e.g. two of { REF DonationD1 \h  \* MERGEFORMAT } in cell A2), but there's nothing to indicate which cells you want to sum. While I can see you have formulae like =SUM(1,2,3) and =SUM(A,B,C), perhaps intended to reference the corresponding cells in columns C & D, these aren't in fields, besides which you can't sum text. Also, to have any formula fields auto-calculate in this document, your formfields need their 'calculate on exit' property set.

----------


## Gavalar

Hi Macropod

Your probably right with teh reference but I believe that is an entirly different problem as I'm trying to get the donation number from a previous table into that one.  I'm not in a hurry for this solving just yet, as I'm looking at a macro to generate rows in the 2nd table as those in the 1st are filled in. This will be a new thread when I fix the issue with the 2nd table and finish the main content of the report form.

I have attached the whole document so you can see where I'm going as I've made a few changes.  What I need is for the 4 individual volumes per donation number row to be summed in the total volume column and I can't get it to work.  I have removed the restrictions on the form field entries so you can look at the document.

Thanks again for your input
Gav

HPC form.docx

----------


## macropod

For what you have so far, you don't need any macros. All you need do is set the formfield 'calculate on exit properties' for the relevant formfields fields and use a mix of REF fields to cross-reference their internal bookmark names and _formula_ fields to do the calculations. See attached. I've also deleted what appears to be a redundant FILLIN field.

PS: I'd have replied some hours ago, but I've been having problems getting attachments to upload.

----------


## Gavalar

Hi Macropod

It appears the file is not the document I was expecting as it is does not resemble my form so you may still be having problems?  If it is meant as an example how do you you visualise the fillin fields?

----------


## macropod

Sorry about that, I had all sorts of problems attaching files yesterday - then ended up attaching the wrong one to this thread even though I'd uploaded the right one. Try the attached.

----------

