From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: empty cells in columns should be left emtpy when manipulating columns Date: Fri, 23 Jun 2017 18:20:19 +0200 Message-ID: References: <87shislc0r.fsf@mat.ucm.es> <8737as8ogv.fsf@nicolasgoaziou.fr> <87fueslal4.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dORJn-0007hA-ER for emacs-orgmode@gnu.org; Fri, 23 Jun 2017 12:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dORJm-0006oa-Ca for emacs-orgmode@gnu.org; Fri, 23 Jun 2017 12:20:23 -0400 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:32960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dORJm-0006ne-7f for emacs-orgmode@gnu.org; Fri, 23 Jun 2017 12:20:22 -0400 Received: by mail-qt0-x236.google.com with SMTP id u12so38289319qth.0 for ; Fri, 23 Jun 2017 09:20:20 -0700 (PDT) In-Reply-To: <87fueslal4.fsf@mat.ucm.es> 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" To: Org Mode Hi Uwe On Thu, Jun 22, 2017 at 9:56 AM, Uwe Brauer wrote: > #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E > > And friends did not work any more > > | 3.25 | 0.5) | > | | 0.0) | > #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E This is invalid syntax, what you meant would be: | 3.25 | 0.5 | | | 0.0 | #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E %.1f To preserve empty columns when reformatting you can use the Calc formatter: | 3.25 | 0.5 | | | | #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E f-1 (info "(org) Formula syntax for Calc") `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 not convert empty fields to 0. `f-1' is an optional Calc format string similar to `%.1f' but leaves empty results empty. See also "Which float format shows the fraction part also when the latter is zero?" http://orgmode.org/worg/org-faq.html#table-float-fraction Michael