- 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.5 Column formulas

Often in a table, the same formula should be used for all fields in a particular column. Instead of having to copy the formula to all fields in that column, Org allows you to assign a single formula to an entire column. If the table contains horizontal separator hlines, everything before the first such line is considered part of the table header and will not be modified by column formulas.

To assign a formula to a column, type it directly into any field in the column, preceded by an equal sign, like ‘=$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 the current column, evaluated and the current field replaced with the result. If the field contains only ‘=’, the previously stored formula for this column is used. For each column, Org will only remember the most recently used formula. In the ‘#+TBLFM:’ line, column formulas will look like ‘$4=$1+$2’. The left-hand side of a column formula cannot currently be the name of column, it must be the numeric column reference.

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

C-c =
Install a new formula for the current column and replace current field with the result of the formula. The command prompts for a formula, with default taken from the ‘#+TBLFM’ line, applies it to the current field and stores it. With a numeric prefix argument(e.g. C-5 C-c =) the command will apply it to that many consecutive fields in the current column.
ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition