Permanently summing a column in an Org-mode table

Mauvis Ledford picture Mauvis Ledford · Jul 14, 2011 · Viewed 31.3k times · Source

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.

Answer

huaiyuan picture huaiyuan · Jul 14, 2011

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.