emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-table relative reference questions


From: Michael Brand
Subject: Re: [O] org-table relative reference questions
Date: Tue, 21 Apr 2015 10:13:53 +0200

Hi Jeffrey

On Mon, Apr 20, 2015 at 3:35 PM, Jeffrey Brent McBeth <address@hidden> 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(@address@hidden, find(@address@hidden, 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(@address@hidden, find(@address@hidden, 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]