Next: Updating the table, Previous: Lookup functions, Up: The spreadsheet
You can edit individual formulas in the minibuffer or directly in the field.
Org can also prepare a special buffer with all active formulas of a table.
When offering a formula for editing, Org converts references to the standard
format (like B3
or D&
) if possible. If you prefer to only work
with the internal format (like @3$2
or $4
), configure the
option org-table-use-standard-references
.
org-table-eval-formula
)org-table-eval-formula
)org-table-field-info
)org-table-edit-formulas
)org-table-fedit-finish
)org-table-fedit-abort
)org-table-fedit-toggle-ref-type
)B3
) and internal (like @3$2
).
org-table-fedit-lisp-indent
)lisp-complete-symbol
)B3
and you press S-<right>, it will become C3
.
This also works for relative references and for hline references.
org-table-fedit-line-up
)org-table-fedit-line-down
)org-table-fedit-scroll-down
)org-table-fedit-scroll-up
)Making a table field blank does not remove the formula associated with the field, because that is stored in a different line (the ‘#+TBLFM’ line)—during the next recalculation the field will be filled again. To remove a formula from a field, you have to give an empty reply when prompted for the formula, or to edit the ‘#+TBLFM’ line.
You may edit the ‘#+TBLFM’ directly and re-apply the changed equations with C-c C-c in that line or with the normal recalculation commands in the table.
You may apply the formula temporarily. This is useful when you switch the formula. Place multiple ‘#+TBLFM’ lines right after the table, and then press C-c C-c on the formula to apply. Here is an example:
| x | y | |---+---| | 1 | | | 2 | | #+TBLFM: $2=$1*1 #+TBLFM: $2=$1*2
Pressing C-c C-c in the line of ‘#+TBLFM: $2=$1*2’ yields:
| x | y | |---+---| | 1 | 2 | | 2 | 4 | #+TBLFM: $2=$1*1 #+TBLFM: $2=$1*2
Note: If you recalculate this table (with C-u C-c *, for example), you will get the following result of applying only the first ‘#+TBLFM’ line.
| x | y | |---+---| | 1 | 1 | | 2 | 2 | #+TBLFM: $2=$1*1 #+TBLFM: $2=$1*2
When the evaluation of a formula leads to an error, the field content
becomes the string ‘#ERROR’. If you would like see what is going
on during variable substitution and calculation in order to find a bug,
turn on formula debugging in the Tbl
menu and repeat the
calculation, for example by pressing C-u C-u C-c = <RET> in a
field. Detailed information will be displayed.