# Thread: help with tables (2007)

1. ## help with tables (2007)

Hi!

I'm doing a tablet that calculates a total price from quantity and unit price (sort of invoice) but the rows quantity can be variable.
im doing something like

a1*b1
a2*b2
etc

right now I'm doing all the formulas one by one but its a hassle
i tried to copy the formula to another cell but the values are the same, if i copy the cell containing a1*b1 to the cell that would correspond to a3*b3 the value will still be a1*b1 instead of a3*b3 (excel like) is there any way to automate this cells in a way that i can get a sequence

a1*b1
a2*b2
a3*b3

(like pulling down the lower-right cell corner in excel?)

TIA

2. ## Re: help with tables (2007)

Hi bigsapo,

Welcome to the Lounge.

To see how you can use relative cell addressing in Word tables, see <post#=365442>post 365442</post#>

3. ## Re: help with tables (2007)

I've been reading your document since yesterday (BTW got some really nice tips)

just saw the Relative Referencing In Tables that you said, but to be honest... i don't understand how to use it and implement...

would you be so kind to explain a little, like if i was a 3 year old kid ;-)

thanks again

4. ## Re: help with tables (2007)

Hi bigsapo,

If you look at the formula in cell D1 of the relative referencing example, you'll see:
{QUOTE
{SET Row {SEQ Row}}
{SET ColA "A{=Row}"}
{SET ColB "B{=Row}"}
{SET ColC "C{=Row}"}
{={ColA}*{ColB}+{ColC} # \$,0.00;-\$,0.00}
}
The '{SET Row {SEQ Row}}' expression creates a bookmark (named Row) using a SEQ field. Since the field is on row 1, the SEQ value matches the current row.

The next 3 lines create bookmarks (ColA - ColC) incorporating columns letters (A-C) and the number returned by the row bookmark. On row 1, these bookmarks will be A1-C1.
The penultimate line does the math and, for row 1, equates to =A1*B1+C1. the formatting switch '# \$,0.00;-\$,0.00' tells Word to format the result as dollar & cent currency value, with a thousands separator.

For your purposes, the field could be reduced to:
{QUOTE
{SET Row {SEQ Row}}
{SET ColA "A{=Row}"}
{SET ColB "B{=Row}"}
{={ColA}*{ColB}}
}
plus whatever formatting switches you want.

The formula in cell E1 does the same math with a slightly more complex field construction:
{QUOTE
{Set CellA "a{={SEQ RowNr}/2}"}
{Set CellB "b{={SEQ RowNr c}/2}"}
{Set CellC "c{={SEQ RowNr c}/2}"}
{={CellA}*{CellB}+{CellC} # \$,0.00;-\$,0.00}
}
For your purposes, you could reduce this to:
{QUOTE
{Set CellA "a{={SEQ RowNr}/2}"}
{Set CellB "b{={SEQ RowNr c}/2}"}
{={CellA}*{CellB}}}
}
plus whatever formatting switches you want.

As explained in the tutorial document, the second form of the field has the advantage of retaining its display of the calculated values after the document is closed & re-opened.

Note: there is no significance in the difference in the Row/RowNr bookmark names for the two examples, except to differentiate them.

5. ## Re: help with tables (2007)

WOW!!

thanks a lot for your patience and time!
that did the trick

you saved my day

big thanks

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•