emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: table: problem with nan and if
Date: Tue, 22 Jun 2021 11:03:33 +0200	[thread overview]
Message-ID: <87a6nigtju.fsf@mat.ucm.es> (raw)
In-Reply-To: 71e8527a-b336-0f59-9ce4-7d3d7f900e10@free.fr

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

  reply	other threads:[~2021-06-22  9:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6nigtju.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).