OpenOffice.Org 1.0 Resource Kit

You don't even need to switch over to Calc to get complex calculations into your document; just insert them in Writer.

Making Calculations in Writer Table Cells

One of the most impressive features of Writer tables is the ability to perform calculations in cells like the ones you can create in a spreadsheet application.

Inserting a Sum Quickly

  1. Click in the cell you want to contain the solution to the formula, as in Figure 8-23

    Figure 8-23. Where you want the sum to appear

  2. Click the sum icon in the object bar, as shown at right

  3. The default formula that the program thinks you want will appear in the function bar.

  4. Click the green arrow; the sum will appear in the table as shown in Figure 8-24.

    Figure 8-24. The automatic sum inserted in the cell

Inserting a Formula

  1. Click in the cell you want to contain the solution to the formula.

  2. Press the F2 key to display the formula box (just above the object bar).

  3. Enter a formula. Be sure to begin the formula with an equals sign, and click cells to include a reference to their contents in the formula. If you need help with structuring your formula and using cell references, see Chapter 20, Calculating and Manipulating Data , on page 559.

    You can also click and hold down the Formula button in the formula bar for help inserting certain formula elements.

  4. Click the Apply button or press Enter to calculate the formula.

When you change numbers in the cells that were referenced in the formula, the calculated amount changes. If for some reason it doesn't change, click in the calculated cell and press the F9 key.

If you want to include more sophisticated tables in your Writer docs, you can insert parts of or entire Calc spreadsheets. See Spreadsheets on page 291.

The syntax for cell references is different in a Writer table than it is in a Calc spreadsheet. In a Writer table, cell references must be opened and closed by the less-than and greater-than symbols. For example, a reference to cell B4 would need to be entered as <B4> . If you're building a formula, and you click a cell to add it to the formula, this syntax is used automatically.

Also, as shown in Figure 8-25, you can use a pipe symbol "" instead of a plus symbol "+". You can't do that in Calc.

Figure 8-25. Performing calculations in Writer tables

Making Calculations in Body Text

You can also make one-time calculations outside of cells in the body text of your document, though this isn't particularly useful if any of the numbers in your formula changes, because the calculated amount won't adjust automatically.

  1. Enter the formula in your text followed by an equals sign. For example:

    (45+15+120)/5=

  2. Copy the formula.

  3. Press F2, and paste the formula into the formula box.

  4. Press Enter. The solution to the formula is displayed in the text as a field.

Категории