最好用代码解释:

|                |  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),工作正常。我想最后一列(在
@ 2 .. @ 4行)将每一行中的值相加。我该如何表达?

最佳答案

解决了。我在组织模式表方面的知识存在一些根本性的不足

|                |  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)

这个org as spreadsheet tutorial很有帮助。

关于emacs - 行范围内的组织模式总和值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15983481/

10-10 11:17