7

最好用代码解释:

|                |  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 中)对每一行中的值求和。我该如何表达?

4

1 回答 1

4

解决了。我的 org-mode 表知识有一些基本的空白

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

这个作为电子表格教程的组织很有帮助。

于 2013-04-13T05:12:11.380 回答