Emacs, scripting and anything text oriented.

Org Table Spreadsheet

Kaushal Modi

My notes on Org Table Spreadsheet feature.

Normalizing #

Table 1: Org table Normalizing
Normalized col $1Normalized col $3Ratio of col $2 / $4
Col $1Col $2Col $3Col $4Col $5
79922.16.850.1469938244.271.60
79185.96.780.1469760084.271.59
64041.05.480.1470670314.271.28
15452.51.320.0344567131.001.32
11675.71.000.0344601621.001.00

Equations Breakdown #

Equation: #+tblfm: $2=$1/@7$1;%0.2f::$4=$3/@7$3;%0.2f::$5=$2/$4;%0.2f

  • $2=$1/@7$1 – Assign the value of a field in column 2 ($2) to the value of the field in column 1 in the same row ($1) divided by the value of the field in row 7, column 1 (@7$1).
    • @ is row, $ is column.
    • Row and column numbers start with 1 (not 0).
  • $4=$3/@7$3 – Similar to above, but with different row/column numbers.
  • $5=$2/$4 – Assign the value of a field in column 5 ($5) to the value of the field in column 2 in the same row ($2) divided by the value of the field in column 4 in the same row as well ($4).
  • ; is used to separate the equation from the formatting.
  • For all the 3 equations, formatting is applied using %0.2f i.e. the numbers will be formatted with 2 decimal places. See Field Formatters in Org table for more info.
  • Each of those equations are applied to the same table by concatenating them with ::.

Evaluate the whole table #

Do C-u C-c C-c with point anywhere in the table, or do C-c C-c with point on the #+tblfm line.

References #