Hi John,
In Word, you can insert a formula by pressing Ctrl-F9 to
create a field, then typing the formula between the braces
eg:
{=a1+b1}
In many cases, the syntax can be the same as for excel,
though all cell referencing in Word is absolute - without
the '$' you'd use in Excel. Relative referencing can be
implemented, but I'd suggest you stick with the std
absolute referencing until you've mastered Word formulae.
Word has some quirks when it comes to evaluating or
returning text and/or nul values. For example, if you want
a field that only evaluates b2-b1 if b2 is empty or has
any numeric value other than 0, you could use:
{=IF(b2=0,0,b2-b1)} or {=IF(b2,b2-b1,0)}
For a field that evaluates b2-b1 if b2 has any numeric
value including 0, you could use:
{=IF(COUNT(b4)=0,0,c3+b4)}
In each case, if you want to hide '0' results, you can put
a numeric switch like \# #;-#; before the final brace -
the final ';' tells Word not to display 0 results.
Note: If you change the font attributes of the numeric
switches (eg fore/back colour, bold, etc), the field
result will display with those attributes.
Things come unstuck using an Excel syntax in a Word table
if you want to have a nul result or evaluate a text
string. In Excel you'd use:
=IF(b2=0,"",b2-b1)
to return a nul result but, the equivalent field in Word:
{=IF(b2=0,"",b2-b1)}
produces a syntax error. You then need to resort to
constructs like:
{IF{=COUNT(b2)}= 0 "" {=(b2-b1)}}
Word tables can't evaluate text strings, including dates,
at all using cell references. The only way of doing so is
to bookmark the cell's contents (not the cell itself), and
then evaluate the bookmark, like:
{IF{BkMrk}= "True Text" "True Response" {=(b2-b1)}}
Note: If you change the font attributes of the true/false
responses (eg fore/back colour, bold, etc), the field
results will display with those attributes. This can be
combined with font attributes for numeric switches (see
above).
That should get you started.
Cheers
PS: Remove NO.SPAM from the above before replying.