The values ​​of the sums in org-mode in a range of lines

This is best explained by the code:

| | a | b | c | d | row-total | |----------------+----+-----+----+--------+-----------| | check-sum | 4 | 5 | 7 | 1000 | | |----------------+----+-----+----+--------+-----------| | | 1 | 2 | 2 | 1 | | | | 3 | 4 | 5 | 6 | | |----------------+----+-----+----+--------+-----------| | calculated-sum | ok | (1) | ok | (-993) | | |----------------+----+-----+----+--------+-----------| #+TBLFM: @>$<<..$>>='(let ((sum (apply '+ '(@ II..@-1 ))) (expected @2)) (if (= sum expected) "ok" (format "(%s)" (- sum expected))));N 

I have a summary line (@ 5) working fine. I would like to have the last column (in rows @ 2 .. @ 4) summarize the values ​​in each row. How to express it?

+4
source share
1 answer

I decided. I had some fundamental knowledge gaps in the org-mode table

 | | a | b | c | d | row-total | |----------------+----+-----+----+--------+-----------| | check-sum | 4 | 5 | 7 | 1000 | 1016 | |----------------+----+-----+----+--------+-----------| | | 1 | 2 | 2 | 1 | 6 | | | 3 | 4 | 5 | 6 | 18 | |----------------+----+-----+----+--------+-----------| | calculated-sum | ok | (1) | ok | (-993) | | |----------------+----+-----+----+--------+-----------| ,#+TBLFM: @>$<<..$>>='(let ((sum (apply '+ '(@ II..@-1 ))) (expected @2)) (if (= sum expected) "ok" (format "(%s)" (- sum expected))));N::@2$> ..@4 $>=vsum($2..$5) 

This org as a spreadsheet tutorial was helpful.

+2
source

All Articles