From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: Re: problem with lookup, count several string in one (or more) columns. Date: Tue, 05 Jul 2016 12:22:08 +0000 Message-ID: <874m84gtqn.fsf@mat.ucm.es> References: <877fd1b2h8.fsf@mat.ucm.es> <84r3b8pohn.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKPMr-0000su-Ux for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 08:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKPMn-0005kD-Nu for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 08:22:20 -0400 Received: from plane.gmane.org ([80.91.229.3]:58355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKPMn-0005jb-HF for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 08:22:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bKPMl-0004Ry-UF for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 14:22:16 +0200 Received: from gilgamesch.quim.ucm.es ([147.96.12.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Jul 2016 14:22:15 +0200 Received: from oub by gilgamesch.quim.ucm.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Jul 2016 14:22:15 +0200 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: emacs-orgmode@gnu.org > Uwe Brauer writes: > What about > #+TBLFM: @>$3='(+ (length(org-lookup-all "NP" '(@2$2..@-1$3) nil)) (length(org-lookup-all "MH" '(@2$2..@-1$3) nil))); > ? You mean | group | round 1 | round 2 | |-------+---------+---------| | A | | 2.4 | | B | 4.7 | 11 | | C | | MH | | D | 5 | | | E | | 7.2 | | F | 3.2 | 4.3 | | G | NP | 4.4 | | H | NP | 8 | | I | NP | 8 | |-------+---------+---------| | total | MH | 4 | #+TBLFM: @>$3='(+ (length(org-lookup-all "NP" '(@2$2..@-1$3) nil)) (length(org-lookup-all "MH" '(@2$2..@-1$3) nil))); That gives | total | MH | 4 | But I want | total | MH | 1 | | total | NP | 3 | regards Uwe