From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell Adams Subject: Re: Table equations: II on lhs Date: Mon, 1 Feb 2010 12:58:21 -0600 Message-ID: <20100201185821.GI18633@thinkpad.adamsinfoserv.com> References: <1513b3111002010908l10a2fe09y34370a2cac29b371@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nc1Ts-0008De-9G for emacs-orgmode@gnu.org; Mon, 01 Feb 2010 13:58:40 -0500 Received: from [199.232.76.173] (port=45020 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nc1Tq-0008DW-V8 for emacs-orgmode@gnu.org; Mon, 01 Feb 2010 13:58:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nc1To-0007IZ-O9 for emacs-orgmode@gnu.org; Mon, 01 Feb 2010 13:58:38 -0500 Received: from squirtle.drak.net ([72.52.144.201]:57156) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nc1To-0007IP-DG for emacs-orgmode@gnu.org; Mon, 01 Feb 2010 13:58:36 -0500 Received: from 206.180.155.43.adsl.hal-pc.org ([206.180.155.43] helo=localhost) by squirtle.drak.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Nc1TY-0002sP-8H for emacs-orgmode@gnu.org; Mon, 01 Feb 2010 12:58:20 -0600 Content-Disposition: inline In-Reply-To: <1513b3111002010908l10a2fe09y34370a2cac29b371@mail.gmail.com> 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 On Mon, Feb 01, 2010 at 12:08:20PM -0500, Kim Toms wrote: > I am using a simple table to add up some estimates for tasks. On the left > hand side of the equations in the TBLFM line I can't get an expression like > @II$2 to work. > > Here's an example > | task | estimate | probable | > |-------+----------+----------| > | one | 12 | 2 | > | two | 10 | 3 | > |-------+----------+----------| > | total | 22 | 5 | > #+TBLFM: @4$2=vsum(@I..@II-1)::@4$3=vsum(@I..@II-1) > > I'd like to be able to put @II$2 on the LHS of the equation. That way, when > I add a row to the table, the equation doesn't have to change. > > A workaround for the above table is to use $LR2 and $LR3 instead of the more > general references. I do this fairly often. Just use enter to add a row in the table, the references are automatically updated. Now, if you copy and paste it won't work. I just tried your example with the LR, and that worked fine for me. |-------+----------+----------| | task | estimate | probable | |-------+----------+----------| | one | 12 | 2 | | two | 10 | 3 | | three | 8 | 8 | | three | 8 | 8 | | three | 8 | 8 | | three | 8 | 8 | |-------+----------+----------| | total | 54 | 37 | |-------+----------+----------| #+TBLFM: $LR2=vsum(@-I..@-II)::$LR3=vsum(@-I..@-II) This isn't copy/paste sensitive at all. Does that answer your question? ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3