From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Check on empty does not work Date: Sun, 1 Jun 2014 12:58:11 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr3Sw-0006x1-1y for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 06:58:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wr3Su-0005gz-WE for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 06:58:13 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:59238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr3Su-0005gk-TH for emacs-orgmode@gnu.org; Sun, 01 Jun 2014 06:58:12 -0400 Received: by mail-qg0-f49.google.com with SMTP id a108so8896061qge.36 for ; Sun, 01 Jun 2014 03:58:11 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Cecil Westerhof Cc: Org Mode Hi Cecil On Sun, Jun 1, 2014 at 12:00 PM, Cecil Westerhof wrote: > 2014-06-01 11:50 GMT+02:00 Cecil Westerhof : >> I am trying the following: >> #+TBLFM: @-I$4..@+I$4 = if("$3" == "nan", string(""), $3 - $2) ; %.1f >> and: >> #+TBLFM: @-I$4..@+I$4 = if("$3" == "", string(""), $3 - $2) ; %.1f >> >> But in both case the fourth field is filled when the third field is empty. >> What am I doing wrong? >> >> I am using version 8.2.1. > > The following does work: > #+TBLFM: @-I$4..@+I$4 = if($3 - $2 == -$2, string(""), $3 - $2) ; > > But is not what is described. > > I removed > %.1f > because that displays an empty string as 0.0. > > Is it possible to use %.1f without making an empty field displayed as 0.0? I suggest that I will improve the TBLFM example about "nan" in the manual like this: `if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1' Sum of the first two columns. When at least one of the input fields is empty the Org table result field is set to empty. `E' is required to leave empty fields without conversion to 0. `f-1' is an optional Calc format string similar to `%.1f' but leaves empty results empty. Would this have answered all your questions? Michael