It's best explained with 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 row (@5) working fine. I'd like to have the last column(in rows @2..@4) sum the values in each row. How do I express that?
Solved it. I had some fundamental gaps in my org-mode table knowledge
| | 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 spreadsheet tutorial was helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With