From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: problem with lookup, count several string in one (or more) columns. Date: Tue, 05 Jul 2016 08:50:44 +0200 Message-ID: <84r3b8pohn.fsf@gmail.com> References: <877fd1b2h8.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKKCO-0001s8-LG for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 02:51:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKKCL-0001lK-Ir for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 02:51:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:43493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKKCL-0001l8-Ba for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 02:51:09 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bKKCK-0001tu-1t for emacs-orgmode@gnu.org; Tue, 05 Jul 2016 08:51:08 +0200 Received: from x5f70281f.dyn.telefonica.de ([95.112.40.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Jul 2016 08:51:08 +0200 Received: from marcowahlsoft by x5f70281f.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Jul 2016 08:51:08 +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: > Hello > > I tried to follow the instructions found in > http://orgmode.org/worg/org-tutorials/org-lookups.html > > So I want to count all strings NP MH in the following table > According to the instructions, the following will search the string MH. > > | 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 | 1 | > > #+TBLFM: @>$3='(length(org-lookup-all "MH" '(@2$2..@-1$3) nil)); > > So I could repeat that for the string NP as well but how can I search > for both (or more) strings at once? What about #+TBLFM: @>$3='(+ (length(org-lookup-all "NP" '(@2$2..@-1$3) nil)) (length(org-lookup-all "MH" '(@2$2..@-1$3) nil))); ? Best regards, -- https://marcowahl.github.io