From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: noob question : In a table , how to update a formula when inserting a new line Date: Fri, 07 May 2010 22:56:49 -0400 Message-ID: <8026.1273287409@gamaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAaE2-0008HD-Vn for emacs-orgmode@gnu.org; Fri, 07 May 2010 22:57:11 -0400 Received: from [140.186.70.92] (port=57010 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAaE1-0008H5-GQ for emacs-orgmode@gnu.org; Fri, 07 May 2010 22:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAaDz-0001xI-Pg for emacs-orgmode@gnu.org; Fri, 07 May 2010 22:57:09 -0400 Received: from vms173005pub.verizon.net ([206.46.173.5]:57582) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAaDz-0001x9-Lr for emacs-orgmode@gnu.org; Fri, 07 May 2010 22:57:07 -0400 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L22002VSYUQ674C@vms173005.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 07 May 2010 21:56:50 -0500 (CDT) In-reply-to: Message from Matt Chastagnier of "Sat, 08 May 2010 04:21:34 +0200." 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: Matt Chastagnier Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Matt Chastagnier wrote: > I've just started with org-mode and have done several tutorials. But I'm > stuck with this problem for 3 hours : > > > I have : > > | item | quantity | > |---------+----------| > | laptop | 4 | > | desktop | 7 | > |---------+----------| > | Total | 11 | > > #+TBLFM: @4$2=vsum(@I..@II) > > I insert a new line [because I will want to add a new item] (M-S down) and > update the table (C-u C-c C-c) : > > | item | quantity | > |---------+----------| > | laptop | 4 | > | desktop | 7 | > | | 11 | > |---------+----------| > | Total | 11 | > > #+TBLFM: @4$2=vsum(@I..@II) > > but my formula isn't updated automatically so the wrong field is updated. I > would like the formula to become @5$2 instead of @4$2 automatically. > I've searched during 2 hours with google but found nothing :/ ... Is it > possible to do it? Cause It's very annoying to update the formula "by hand" > (sorry for my english). > You looked in the wrong place :-) If you look in section 3.5.1, "References", in the Org manual, you'll find ,---- | As a special case, references like `$LR5' and `$LR12' can be used to | refer in a stable way to the 5th and 12th field in the last row of the | table. `---- So make your formula #+TBLFM: $LR2=vsum(@I..@II) HTH, Nick