From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jude DaShiell Subject: Re: calculating column averages follow up Date: Sat, 23 Jul 2011 04:56:10 -0400 (EDT) Message-ID: References: <11092.1311332109@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkY0K-0005AR-SQ for emacs-orgmode@gnu.org; Sat, 23 Jul 2011 04:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkY0J-0000Jw-Nb for emacs-orgmode@gnu.org; Sat, 23 Jul 2011 04:56:12 -0400 Received: from shellworld.net ([69.60.117.94]:62490 helo=server1.shellworld.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkY0J-0000Jr-IF for emacs-orgmode@gnu.org; Sat, 23 Jul 2011 04:56:11 -0400 In-Reply-To: <11092.1311332109@alphaville.dokosmarshall.org> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org Thanks, here's what I have now and it almost works. When I add a new line though the averages don't change until I delete the TBLFM: line and the line with the =vmean(@2..-1) formulas on it then key the formulas in again. Then the averages do update to reflect new numbers. That's not a difficulty though, I can easily handle that light work using a sed script. | Date Stamp | Systalic | Diastalic | Pulse | | | | | | | | |------------------------+----------+-----------+-------+---+---+---+---+---+---+---| | [2011-07-19 Tue 02:26] | 138 | 92 | 74 | | | | | | | | | [2011-07-21 Thu 03:50] | 128 | 79 | 76 | | | | | | | | | [2011-07-20 Wed 04:03] | 130 | 85 | 74 | | | | | | | | | [2011-07-22 Fri 02:33] | 121 | 80 | 79 | | | | | | | | | [2011-07-23 Sat 02:52] | 118 | 75 | 68 | | | | | | | | |------------------------+----------+-----------+-------+---+---+---+---+---+---+---| | Averages | 127 | 82.2 | 74.2 | | | | | | | | | | | | | | | | | | | | #+TBLFM: $2=vmean(@2..-1)::$3=vmean(@2..-1)::$4=vmean(@2..-1) # Local Variables: # kept-new-versions: 100 # version-control: t # End: - On Fri, 22 Jul 2011, Nick Dokos wrote: > Jude DaShiell wrote: > > > I removed a separator line above averages and removed a row with blank > > fields and ran the calculation on this table and it does have a defective > > formula but I don't know where the defect is now. > > > > | Date Stamp | Systalic | Diastalic | Pulse | | | | | | | | > > |------------------------+----------+-----------+-------+---+---+---+---+---+---+---| > > | [2011-07-19 Tue 02:26] | 138 | 92 | 74 | | | | | | | | > > | [2011-07-21 Thu 03:50] | 128 | 79 | 76 | | | | | | | | > > | [2011-07-20 Wed 04:03] | 130 | 85 | 74 | | | | | | | | > > | [2011-07-22 Fri 02:33] | 121 | 80 | 79 | | | | | | | | > > | Averages | #ERROR | | | | | | | | | | > > | | | - | | | | | | | | | > > | | | | | | | | | | | | > > #+TBLFM: $2=vmean(@<..@>) > > > > Two problems: 1) you want to set a single cell but the way the formula is written > makes it a column formula and 2) the rows as written include the header line and go > all the way to the bottom - assuming you want the two rows after the "Averages" row, > you can say > > #+TBLFM: @>>>$2=vmean(@<<..@>>>>) > > That says "the third row from the bottom in column two is the mean of the rows in the > same column, ranging from second from the top to fourth from the bottom". > > I thought I could use references relative to @> (e.g. @>-3) but apparently that's > not the case: > > #+TBLFM: @>>>$2=vmean(@<<..@>-3) > > does not work for me. > > Nick > >