[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: table: problem with nan and if
From: |
Uwe Brauer |
Subject: |
Re: table: problem with nan and if |
Date: |
Tue, 22 Jun 2021 11:03:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>>> "t" == tbanelwebmin <tbanelwebmin@free.fr> writes:
> About the E format setting, you may look at documentation here:
> [[info:org#Formula syntax for Calc]]
Thanks I tried, but I think the core of the problem is that $7 needs two
ifs with two commands
#+begin_src elisp
Case I $6 empty
#+NAME: test
| Name | E1 | E2 | E3 | Result1 | Result2 | Final |
|-------+----+----+-----+---------+---------+-------|
| User1 | | | | | 8 | nan |
| User2 | | | | | | |
| User3 | 1 | 0 | 3.5 | 4.5 | 5.8 | 4.8 |
|-------+----+----+-----+---------+---------+-------|
#+TBLFM: $5=if(typeof(vsum($2..$4)) == 12, string(" "),vsum($2..$4));E
f-1::$7=if("$6" == "nan", string(" "),0.3*$5+0.6*$6);E f-1
Case II $5 empty
#+NAME: test2
| Name | E1 | E2 | E3 | Result1 | Result2 | Final |
|-------+----+----+-----+---------+---------+--------|
| User1 | | | | | 8 | #ERROR |
| User2 | | | | | | #ERROR |
| User3 | 1 | 0 | 3.5 | 4.5 | 5.8 | #ERROR |
|-------+----+----+-----+---------+---------+--------|
#+TBLFM: $5=if(typeof(vsum($2..$4)) == 12, string(" "),vsum($2..$4));E
f-1::$7=if("$5" == "nan", 0.6*$6),0.3*$5+0.6*$6);E f-1
#+end_src
But even the second case does not work, sigh
smime.p7s
Description: S/MIME cryptographic signature