From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey Brent McBeth Subject: Re: org-table relative reference questions Date: Tue, 21 Apr 2015 10:43:47 -0400 Message-ID: <20150421144347.GF16503@broggs.org> References: <20150420133528.GB16503@broggs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkZPK-0008Ka-9X for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 10:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkZPG-0007lB-75 for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 10:44:14 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.227]:48193 helo=cdptpa-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkZPG-0007kx-3T for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 10:44:10 -0400 Received: from williwaw ([10.0.1.2]) by broggs.org with esmtp (Exim 4.82) (envelope-from ) id 1YkZPD-0004Dm-5V for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 10:44:07 -0400 Received: from localhost ([127.0.0.1] helo=broggs.org) by williwaw with esmtp (Exim 4.84_RC1) (envelope-from ) id 1YkZOt-000500-VA for emacs-orgmode@gnu.org; Tue, 21 Apr 2015 10:43:48 -0400 Content-Disposition: inline In-Reply-To: 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: emacs-orgmode@gnu.org On Tue, Apr 21, 2015 at 10:13:53AM +0200, Michael Brand wrote: > 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) That is awesome. subvec and if seem to be two very powerful tools that I've missed as I've trawled the documentation. Thank you so much. Jeff -- "The man who does not read good books has no advantage over the man who cannot read them." -- Mark Twain