Results 1 to 5 of 5
Thread: help with tables (2007)

20070307, 23:02 #1
 Join Date
 Mar 2007
 Posts
 3
 Thanks
 0
 Thanked 0 Times in 0 Posts
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 lowerright cell corner in excel?)
TIA

20070307, 23:10 #2
 Join Date
 May 2002
 Location
 Canberra, Australian Capital Territory, Australia
 Posts
 5,005
 Thanks
 2
 Thanked 406 Times in 335 Posts
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#>Cheers,
Paul Edstein
[MS MVP  Word]

20070307, 23:19 #3
 Join Date
 Mar 2007
 Posts
 3
 Thanks
 0
 Thanked 0 Times in 0 Posts
Re: help with tables (2007)
thanks for your answer and welcome note ;)
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

20070307, 23:41 #4
 Join Date
 May 2002
 Location
 Canberra, Australian Capital Territory, Australia
 Posts
 5,005
 Thanks
 2
 Thanked 406 Times in 335 Posts
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 (AC) and the number returned by the row bookmark. On row 1, these bookmarks will be A1C1.
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 & reopened.
Note: there is no significance in the difference in the Row/RowNr bookmark names for the two examples, except to differentiate them.Cheers,
Paul Edstein
[MS MVP  Word]

20070308, 00:19 #5
 Join Date
 Mar 2007
 Posts
 3
 Thanks
 0
 Thanked 0 Times in 0 Posts
Re: help with tables (2007)
WOW!!
thanks a lot for your patience and time!
that did the trick
you saved my day
big thanks