- publishing free software manuals
The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
ISBN 9781906966089
RRP £9.95 ($14.95)

Sales of this book support the Org project! Get a printed copy>>>

15.4 Field formulas

To assign a formula to a particular field, type it directly into the field, preceded by ‘:=’, for example ‘:=$1+$2’. When you press TAB or RET or C-c C-c with the cursor still in the field, the formula will be stored as the formula for this field, evaluated, and the current field replaced with the result.

Formulas are stored in a special line starting with ‘#+TBLFM:’ directly below the table. If you type the equation in the 4th field of the 3rd data line in the table, the formula will look like ‘@3$4=$1+$2’. When inserting/deleting/swapping column and rows with the appropriate commands, absolute references (but not relative ones) in stored formulas are modified in order to still reference the same field. Of course this is not true if you edit the table structure with normal editing commands--then you must fix the equations yourself. The left-hand side of a formula may also be a named field (see section 15.8 Advanced features), or a last-row reference like ‘$LR3’.

Instead of typing an equation into the field, you may also use the following command

C-u C-c =
Install a new formula for the current field. The command prompts for a formula with default taken from the ‘#+TBLFM:’ line, applies it to the current field, and stores it.
ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition