在org-mode表公式中忽略零

时间:2016-10-25 13:29:26

标签: emacs org-mode

我想要一个用于分割两个单元格的列公式,但如果该计分器为零则忽略一行。

类似的东西:

| 42 | 2 |          21 |
| 42 | 0 | round(42/0) |
#+TBLFM: $3=round($1/$2)

但是第三列是空的而不是round(42/0)

这可能吗?

1 个答案:

答案 0 :(得分:1)

这样做:

| 42 | 2 | 21 |
| 42 | 0 |    |
#+TBLFM: $3=if($2>0,round($1/$2), string(""))

string("")是表示空单元格的方法。这个和if()语法描述为in the manual