Search code examples
emacsorg-modeorg-table

Permanently summing a column in an Org-mode table


In an Emacs Org-mode table, when you have a column full of integers I know you can do C-c + followed by C-y to paste the sum of the values in the column. I want to know the formula to place in the last row to always sum the whole column.

I've tried everything. The docs show you how to sum two columns together but not one.


Solution

  • Assign a field-name using the ^ mark:

    |---+---|
    |   | 1 |
    |   | 2 |
    |   | 3 |
    |---+---|
    |   | 6 |
    | ^ | x |
    |---+---|
    #+TBLFM: $x=vsum(@1..@-1)
    

    See The Org Manual, Section-3.5.9 Advanced Features.