emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] problem with empty column


From: Uwe Brauer
Subject: Re: [O] problem with empty column
Date: Sat, 06 Jan 2018 09:37:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>>> "Eric" == Eric S Fraga <address@hidden> writes:

   > On Friday,  5 Jan 2018 at 13:44, Uwe Brauer wrote:
   >> What I meant is this.

   > I understood what you meant and your code is working properly.  You
   > are checking the second column which is the column labelled E1, not
   > the one labelled E2 which is actually the third column... change your
   > if statement to check $3, not $2.

Maybe the format of the table was distorted.

| Name   | E1 | E2 | E3 | E4 | Res |
|--------+----+----+----+----+-----|
| Entry1 |    |    |    |    |  NP |
| Entry2 | 10 | 20 | 30 | 40 |  10 |
| Entry3 | 10 |    | 20 | 30 | nan |
#+TBLFM: $6=if("$2" == "nan" , string("NP"),($2+$3+$4+$5)/10);E

The column of reference is E1 per default, which is the second one. The
row labeled Entry1 gives the expected result, NP, since its E1 entry is
empty but in the row labeled Entry3 E1 is not empty, so the second part
of the statement should be applied resulting in 6, but it does not it
results in nan, which I don't understand. The fact that E2 ($3) is empty
should be irrelevant here, but it is not.

On the other hand

| Name   | E1 | E2 | E3 | E4 | Res |
|--------+----+----+----+----+-----|
| Entry1 |    |    |    |    |  NP |
| Entry2 | 10 | 20 | 30 | 40 |  10 |
| Entry3 | 10 |  0 | 20 | 30 |   6 |
#+TBLFM: $6=if("$2" == "nan" , string("NP"),($2+$3+$4+$5)/10);E

Gives the expected result, that is adding 0 to E2 in row Entry3.

I am puzzled

Uwe 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]