Hi Jeffrey

On Mon, Apr 20, 2015 at 3:35 PM, Jeffrey Brent McBeth <mcb...@broggs.org> 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

Reply via email to