Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Monday, August 9, 2010

Number formatting in the MS-Word field

Refer to my previous post about simple mathematical calculation in Word.
It is also possible to put format for the result of calculation.
For example,

2500 -20*52.88 = 1442.40  (without thousand separator (comma))

We can set the format by the following steps
  1. Shift-F9 to edit the field
  2. After the formula, add the formatting code as \# ,0.00
  3. The field will look like this { =2500-20*52.88 \#,0.00}
  4. Press F9 to update the field
The result will look like this 2500 -20*52.88 = 1,442.40
(with thousand separator and accuracy of 2 decimal places)

Other variations are, for example,

.. \# 0 for rounded whole numbers
.. \# ,0 for rounded whole numbers with a thousands separator
.. \# ,0.00 for numbers accurate to two decimal places, with a thousands separator
.. \# $,0 for rounded whole dollars with a thousands separator
.. \# $,0.00;($,0.00);- for currency, with brackets around negative numbers and a hyphen for 0 values

Performing (simple) mathematical calculation in Word

Sometimes it is convenient to perform simple mathematical calculation in word.
For example, if the following text is needed to put in word file

C = 42.5/1.1 = 38.64

Instead of using calculator program we can perform calculation in word by the following steps


  1. Type C = 42.5/1.1 =
  2. Ctrl-F9 to create empty field (it will look like this {})
  3. In {} type {=42.5/1.1}
  4. F9 to update the field (word will calculate the above expression for us
You can copy, paste and edit the formula using the following steps
    1. Copy, Paste
    2. Shift-F9 to alter the formula, the change the formula or values as you like.
    3. Press F9 to update the field and toggle back into text mode (now the value should be updated according to the new formula)
    Note: Shift-F9 will toggle only the field you selected while Alt-F9 will toggle all fields in the file (this might be helpful if you want to see the formula in other places or to copy the formula.)