From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: org-table relative reference questions Date: Tue, 21 Apr 2015 10:13:53 +0200 Message-ID: References: <20150420133528.GB16503@broggs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkTJg-0003kY-Cw for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 04:14:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkTJa-0005Yk-CK for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 04:14:00 -0400 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:35116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkTJa-0005Ya-6z for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 04:13:54 -0400 Received: by qgej70 with SMTP id j70so64880246qge.2 for ; Tue, 21 Apr 2015 01:13:53 -0700 (PDT) In-Reply-To: <20150420133528.GB16503@broggs.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: Jeffrey Brent McBeth Cc: Org Mode Hi Jeffrey On Mon, Apr 20, 2015 at 3:35 PM, Jeffrey Brent McBeth wrote: > I'm looking for a way to reference a row or column on both the left > side and right side of a table formula that is "easily" manipulable. As you noticed the left side is very limited compared to the right side. The solution below keeps the left side simple. "x" is used as a movable marker to indicate the beginning of the range: | F | A | B | C | |---+---+---+----| | x | 1 | 3 | 4 | | | 2 | 4 | 69 | |---+---+---+----| | | 3 | | | #+TBLFM: @>$2 = vsum(subvec(@I$2..@II$2, find(@I$1..@II$1, x), 0)); E :: @<<$4..@>>$4 = if("$1" == "(x)", $-2 + $-1, $0) | F | A | B | C | |---+---+---+----| | | 1 | 3 | 42 | | x | 2 | 4 | 6 | |---+---+---+----| | | 2 | | | #+TBLFM: @>$2 = vsum(subvec(@I$2..@II$2, find(@I$1..@II$1, x), 0)); E :: @<<$4..@>>$4 = if("$1" == "(x)", $-2 + $-1, $0) For the details see the Org manual about spreadsheet and the Calc manual. Michael