and it simplifies a lot writing functions.How so?
thank you Michael, for answering Nicolas' question, in a different and much structured way than I did in my original message.
the formula you provided —I reduced it slightly, hard coding a constant— looks like this:
(if (> @# 4) (format "%.2f" (/ (apply '+ (subseq '(@I$2..@II$2) (- @# 1 4) (- @# 1))) 4.0)) ""));N
my impression is this programs in the spreadsheet something that should be part of the org-table software.
if we let references leading outside the table return 'nil
instead of raising an error, and represent 'nil by the empty
string, then this is enough:
(when (> @# 4) (/ (+ @-3$2..$2) 4.0));L%0.2f
my suggestion is to associate 'nil with empty cells "both ways",
in the sense that a formula returning 'nil causes an empty
org-table cell (see above), and that the empty cell, through the L
filter evaluates to nil and not to the empty string. this for
symmetry, and for uniformity with reference leading outside the
table.
regards,
MF