From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: problem with empty column Date: Fri, 5 Jan 2018 14:55:33 +0100 Message-ID: References: <87h8s0yaj5.fsf@mat.ucm.es> <87zi5sk5ru.fsf@gmail.com> <87lghcwk3f.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]:39823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXSTA-0005EY-Gp for emacs-orgmode@gnu.org; Fri, 05 Jan 2018 08:55:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXST9-0004rD-CL for emacs-orgmode@gnu.org; Fri, 05 Jan 2018 08:55:36 -0500 Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:37622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXST9-0004qY-82 for emacs-orgmode@gnu.org; Fri, 05 Jan 2018 08:55:35 -0500 Received: by mail-qt0-x230.google.com with SMTP id f2so5757320qtj.4 for ; Fri, 05 Jan 2018 05:55:34 -0800 (PST) In-Reply-To: <87lghcwk3f.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 Fri, Jan 5, 2018 at 1:44 PM, Uwe Brauer wrote: > But fails if there is a row like this > > | 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 I think you are looking for this: | Name | E1 | E2 | E3 | E4 | Res | |--------+----+----+----+----+-----| | Entry1 | | | | | NP | | Entry2 | 10 | 20 | 30 | 40 | 10 | | Entry3 | 10 | | 20 | 30 | NP | #+TBLFM: $6 = if(typeof(vsum($2..$5)) == 12 , string("NP"), vsum($2..$5) / 10); E See the example if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E in the manual. Michael