>>> "Eric" == Eric S Fraga <esfli...@gmail.com> 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