emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] how to refer row's by name in a spreadsheet formula?


From: Bastien
Subject: Re: [O] how to refer row's by name in a spreadsheet formula?
Date: Fri, 08 Jul 2011 10:14:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Jiang,

"address@hidden" <address@hidden> writes:

> Formulas reference in a long table are very easy corrupted by
> manually inserting. so, I think, refer using name instead of num. is
> better.
>
> but how to refer the rows by name?
>
> For example,
>
> |---+------+---------+--------+---------+------|
> | ! | date | amount  | item   | account | note |
> |   | date | amount  | item   | account | note |
> |---+------+---------+--------+---------+------|
> | _ |      | bamount |        |         |      |
> |   |      | 12      | lunch  | pocket  |      |
> |   |      | 59      | dinner | pocket  |      |
> | ^ |      | eamount |        |         |      |
> |---+------+---------+--------+---------+------|
> | _ |      | total   |        |         |      |
> | # |      | #ERROR  |        |         |      |
> |---+------+---------+--------+---------+------|
> #+TBLFM: $total=vsum($bamount..$eamount);%.2f
>
> I'd expected $bamount..$eamount is the range of
> @address@hidden, but it's not. $bamount and $eamount are
> epxanded to the values too early.

I see the problem you have.  

To my understanding, field names like "bamount" and "eamount" refer to
the _value_ of the above/below field, not to the _position_.  So when
the formula is computed, these names are replaced by values, not by
position -- hence the result you have.

I'm not sure this is by design.

Maybe Carsten can tell more, and/or have a look in this issue when he's
back. 

Best,

-- 
 Bastien



reply via email to

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