From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: Determine min/max values in a table Date: Wed, 02 Aug 2017 23:22:56 +0200 Message-ID: <598242B0.8010004@free.fr> References: <2017-08-02T14-05-32@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd16b-00070l-KP for emacs-orgmode@gnu.org; Wed, 02 Aug 2017 17:23:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd16a-0001ln-SS for emacs-orgmode@gnu.org; Wed, 02 Aug 2017 17:23:01 -0400 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]:14812) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dd16a-0001k5-LO for emacs-orgmode@gnu.org; Wed, 02 Aug 2017 17:23:00 -0400 Received: from [IPv6:2a01:e35:2e21:def0:55ff:1b21:1ee3:9452] (unknown [IPv6:2a01:e35:2e21:def0:55ff:1b21:1ee3:9452]) by smtp6-g21.free.fr (Postfix) with ESMTP id AF8457802B2 for ; Wed, 2 Aug 2017 23:22:56 +0200 (CEST) In-Reply-To: <2017-08-02T14-05-32@devnull.Karl-Voit.at> 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 Le 02/08/2017 14:07, Karl Voit a =E9crit : > Hi! > > How can I determine minimum and/or maximum value of a table? > > Here is my example: > > #+NAME: myvalues > | Values | > |--------| > | 4 | > | 2 | > | 3 | > | 7 | > | 5 | > | 6 | > > | Min | Max | Average | First | Last | > |--------+--------+---------+-------+------| > | #ERROR | #ERROR | 4.5 | 4 | 6 | > #+TBLFM: @2$1=3D'(min (remote(myvalues,@2$1..@>$1)))::@2$2=3D'(max (rem= ote(myvalues,@2$1..@>$1)))::@2$3=3Dvmean(remote(myvalues,@2$1..@>$1))::@2= $4=3Dremote(myvalues,@2$1)::@2$5=3Dremote(myvalues,@>$1) > > My goal is to get min=3D=3D2 in the first column and max=3D=3D7 in the > second. > Alternatively you have the orgtbl-aggregate package available on Melpa. #+BEGIN: aggregate :table "myvalues" :cols "min(Values) max(Values) mean(Values)" | min(Values) | max(Values) | mean(Values) | |-------------+-------------+--------------| | 2 | 7 | 4.5 | #+END: