From mboxrd@z Thu Jan 1 00:00:00 1970 From: Austin Frank Subject: ranges of rows in other columns Date: Mon, 26 Jun 2006 16:39:25 -0400 Message-ID: <44A045FD.1080602@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fuxrs-0005Fa-Q2 for emacs-orgmode@gnu.org; Mon, 26 Jun 2006 16:39:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fuxro-0005FO-4o for emacs-orgmode@gnu.org; Mon, 26 Jun 2006 16:39:35 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fuxrn-0005FL-Tl for emacs-orgmode@gnu.org; Mon, 26 Jun 2006 16:39:31 -0400 Received: from [128.151.80.2] (helo=cvs.rochester.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fuy3k-00009p-O9 for emacs-orgmode@gnu.org; Mon, 26 Jun 2006 16:51:52 -0400 Received: from [192.168.82.242] (128.151.80.181) by cvs.rochester.edu with ESMTP (Eudora Internet Mail Server X 3.2.8) for ; Mon, 26 Jun 2006 16:41:45 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all-- I'm looking for help in setting up a calculation in a table in org mode. I'd like to keep a running average of my past three days worth of measurements. Something like |------------------+-----------------+-----------------| | Date | TV Time (hours) | Running Average | |------------------+-----------------+-----------------| | <2006-06-24 Sat> | 1 | | | <2006-06-25 Sun> | 1.5 | | | <2006-06-26 Mon> | .5 | 1 | | <2006-06-27 Tue> | 3 | 1.66 | | <2006-06-28 Wed> | 2.5 | 2 | |------------------+-----------------+-----------------| I just did the numbers for running average in my head-- I'm hoping for help with a formula that will get the mean for the last three rows of the `TV Time' column. I tried using $3=vsum($2&3-1), but this didn't work. Is there a syntax for accessing row ranges of other columns for a calculation? If not, can anyone suggest an elisp formula that will accomplish this? If a helpful soul is feeling especially generous, is there also a way to set this table up that will calculate the new running average every time I enter a new date's measurement? Extra credit if you use Carsten's constants.el to provide units in the measurment column and the calculated column ;) Thanks for any help, /au -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEoEX8lHMl2/XbR4ERAgQMAKDb48ZGq4JlA8NU4g6jBtV/BG3DBwCfb5at OHz4gmF2ONOcPhOUPGWbXow= =zkAf -----END PGP SIGNATURE-----