From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Calc: Second to last row Date: Wed, 31 Aug 2016 18:21:09 -0400 Message-ID: <87pooo8tre.fsf@gmail.com> References: <2016-08-31T17-06-58@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfO8s-0001cj-9R for emacs-orgmode@gnu.org; Thu, 01 Sep 2016 05:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfO8l-0005BJ-00 for emacs-orgmode@gnu.org; Thu, 01 Sep 2016 05:18:37 -0400 Received: from [195.159.176.226] (port=39233 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfO8k-0005AQ-PZ for emacs-orgmode@gnu.org; Thu, 01 Sep 2016 05:18:30 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bfDsr-00063l-Kg for emacs-orgmode@gnu.org; Thu, 01 Sep 2016 00:21:25 +0200 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 Karl Voit writes: > Hi! > > I would like to refer to the second to last row of a table. > > The following example should demonstrate my issue. What I expect is > that the following formula is filling @2..@5 with "1" and in the > last row, there is the sum of all "1". > > It is important to me to ignore the number of horizontal lines since > their number varies in my case. > > | Values | > |--------| > | | > | | > |--------| > | | > | | > |--------| > | | > > #+TBLFM: @2$1..@>-1$1=1 :: @>$1=vsum(@2$1..@>-1$1) This should be: #+TBLFM: @2$1..@>>$1=1 :: @>$1=vsum(@2$1..@>>$1) > > Expected result: > > | Values | > |--------| > | 1 | > | 1 | > |--------| > | 1 | > | 1 | > |--------| > | 4 | > > Actual result: "user-error: Several field/range formulas try to set > @8$1". > > With a fixed number of horizontal lines, the sum would be: > > #+TBLFM: @>$1=vsum(@2$1..@III$1);T > > So how can this be accomplished for an arbitrary number of > horizontal lines? > > > At my side: Org-mode version 8.3.4 (release_8.3.4-33-gd522fc) -- Nick