Results 1 to 4 of 4

20080608, 22:24 #1
 Join Date
 Mar 2006
 Posts
 36
 Thanks
 0
 Thanked 0 Times in 0 Posts
Create a formula in a Word Table (Word 2007)
Hello Again!
I created a Word 2007 template that has a table in it. So far, my simple additions and subtractions work, but at the end of the table I want to calculate a refund that would say, IF D4D5 is less than 0, THEN the total sum of D6 is the result, OR ELSE the sum of D6 is D4D5.
Below is the formula I have been trying to use, but I don't know what to put for the THEN part
+IF (D4D5<0, ??, D4D5)

20080608, 22:35 #2
 Join Date
 Mar 2002
 Posts
 84,353
 Thanks
 0
 Thanked 30 Times in 30 Posts
Re: Create a formula in a Word Table (Word 2007)
It's not clear what you want to accomplish. If you want to place the formula in cell D6, I don't understand what you mean by "the total sum of D6 is the result". If you want to place the formula in another cell, I don't understand what you mean by "the sum of D6 is D4D5".
It might be easier to insert an Excel table in your Word document, since Excel formulas are much easier to create and edit than Word formulas.

20080609, 00:35 #3
 Join Date
 Feb 2001
 Location
 Silicon Valley, USA
 Posts
 23,112
 Thanks
 5
 Thanked 94 Times in 90 Posts
Re: Create a formula in a Word Table (Word 2007)
The following thread probably is your best Lounge resource for writing formulas using Word field codes. Not everything is possible, but if you are willing to nest a lot of fields together, at lot of things can be done. See Word Field Maths (1.3).

20080609, 05:18 #4
 Join Date
 May 2002
 Location
 Canberra, Australian Capital Territory, Australia
 Posts
 5,200
 Thanks
 2
 Thanked 460 Times in 379 Posts
Re: Create a formula in a Word Table (Word 2007)
Hi Giulia,
Assuming you want to sum D16 when D4D5<0, you could use a field coded as:
{=IF(D4<D5,SUM(D16),D4D5)}
plus any formatting switches you might need. For IF tests involving straight numeric calculations, the syntax is the same as in Excel.Cheers,
Paul Edstein
[MS MVP  Word]