1. Basics
Prev | Chapter 2. Tutorial | Next

## 1. Basics

Use Tools|Spreadsheet|Show Table Labels to make the table look like a spreadsheet.

Click in cell E2 and use Tools|Spreadsheet|Insert/Edit Formula (shortcut Ctrl-Shift-I) to insert a new formula at caret position.

The Formula Editor is displayed:

After sign '=', type `A2*D2` and then click OK (shortcut Ctrl-Enter).

You have inserted your first formula in the document. A formula is visually represented by a small F icon. Don't worry if you find it ugly: it will disappear when you'll print the document or when you'll convert it to other formats.

Click on the F icon. Notice that:

- The node path bar displays: `/html/body/table/tbody/tr/td/#processing-instruction(xxe-formula)`, which means that a formula is processing instruction `xxe-formula` (more on this later).

- A red line is drawn around the F icon, which means that you have explicitly selected this processing instruction.

- The status bar displays: `=(A2*D2)`. The small F icon is in fact a special purpose button (more on this later).

Copy the formula (Ctrl-C) to the clipboard and paste it (Ctrl-V) in cells E3 and E4.

Now type in cell A2: `2`, tab to cell B2 to type: `xe-1u`, tab again to cell D2 and type: `200`. Do the same in the next two rows: `1`,`xe-5u`,`800` and `1`,`fc-uu`,`3000`. Then click in cell E5 to force an update. The table should now look like this:

### 1.1. Three more formulas to finish first version of the invoice

1. Click in cell E5 and insert formula: =sum(E2:E4)

2. Click in cell E6 and insert formula: =rounddown(E5 * left(D6, len(D6)-1)%, 2)

   left(D6, len(D6)-1) is string "19.6%" without its last character '%'.

   Note that you can use spaces in a formula and that a formula is case-insensitive. For example: SUM(e2:e4) works fine too.

3. Click in cell E7 and insert formula: =E5+E6

Prev | Up | Next
Chapter 2. Tutorial | Home | 2. How does this really work?