emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* table: problem with nan and if
@ 2021-06-21 15:05 Uwe Brauer
  2021-06-21 16:28 ` Eric S Fraga
  2021-06-21 22:26 ` Tim Cross
  0 siblings, 2 replies; 11+ messages in thread
From: Uwe Brauer @ 2021-06-21 15:05 UTC (permalink / raw)
  To: emacs-orgmode


Hi

I have the following table 

#+begin_src elisp
#+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
#+end_src

The calculations for User2 and 3 are fine, but for User1, the final
result is a  "nan".

I see the problem is caused by ; E f-1 I don't understand why because

As in 
#+begin_src elisp
| user1 | User2 |     |
|-------+-------+-----|
|       |     3 | nan |
|     0 |     1 | 0.8 |
#+TBLFM: $3=0.2*$1+0.8*$2; E f-1
#+end_src

I am not sure, but should I use something like 

if("$5" == "nan", string(" "),0.6*$6); E;f-1


But how can I combine both ifs, I am puzzled

Any  help is strongly appreciated.


Uwe Brauer 



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-23  8:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-21 15:05 table: problem with nan and if Uwe Brauer
2021-06-21 16:28 ` Eric S Fraga
2021-06-21 18:58   ` Uwe Brauer
2021-06-22  7:44     ` Eric S Fraga
2021-06-22  7:51       ` tbanelwebmin
2021-06-22  9:03         ` Uwe Brauer
2021-06-22  8:55       ` Uwe Brauer
2021-06-21 22:26 ` Tim Cross
2021-06-22  6:38   ` Uwe Brauer
2021-06-22 18:35     ` Nick Dokos
2021-06-23  8:26       ` Uwe Brauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).