最好用代码解释:
| | 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
我有一个摘要行(@ 5)正常工作。我想要最后一栏(in rows @ 2 .. @ 4)对每行中的值求和。我该如何表达?
答案 0 :(得分:3)
解决了它。我的组织表知识中存在一些基本的差距
| | 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)