From mboxrd@z Thu Jan 1 00:00:00 1970 From: "jiangzuoyan@gmail.com" Subject: how to refer row's by name in a spreadsheet formula? Date: Thu, 7 Jul 2011 16:44:33 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301d41a00e441e04a776bbcb Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QekCe-00011B-Jl for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 04:44:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QekCc-0002nI-Ko for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 04:44:56 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:50954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QekCc-0002nC-Ah for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 04:44:54 -0400 Received: by iyl8 with SMTP id 8so806238iyl.0 for ; Thu, 07 Jul 2011 01:44:53 -0700 (PDT) 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-org --20cf301d41a00e441e04a776bbcb Content-Type: text/plain; charset=UTF-8 Hi list, 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 @II$amount..@III$amount, but it's not. $bamount and $eamount are epxanded to the values too early. Changsheng Jiang --20cf301d41a00e441e04a776bbcb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi list,

Formulas reference in a long table are very eas= y 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 =C2=A0| = item =C2=A0 | account | note |
| =C2=A0 | date | amount =C2=A0| i= tem =C2=A0 | account | note |
|---+------+---------+--------+---------+------|
| _ | =C2= =A0 =C2=A0 =C2=A0| bamount | =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0|
| =C2=A0 | =C2=A0 =C2=A0 =C2= =A0| 12 =C2=A0 =C2=A0 =C2=A0| lunch =C2=A0| pocket =C2=A0| =C2=A0 =C2=A0 = =C2=A0|
| =C2=A0 | =C2=A0 =C2=A0 =C2=A0| 59 =C2=A0 =C2=A0 =C2=A0|= dinner | pocket =C2=A0| =C2=A0 =C2=A0 =C2=A0|
| ^ | =C2=A0 =C2=A0 =C2=A0| eamount | =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2= =A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0|
|---+------+----= -----+--------+---------+------|
| _ | =C2=A0 =C2=A0 =C2=A0| tota= l =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0|
| # | =C2=A0 =C2=A0 =C2=A0| #ERROR =C2=A0| =C2= =A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2= =A0|
|---+------+---------+--------+---------+------|
#+TBLFM: $t= otal=3Dvsum($bamount..$eamount);%.2f

I'd= expected $bamount..$eamount is the range of @II$amount..@III$amount, but i= t's not. $bamount and $eamount are epxanded to the values too early.




=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Changsheng Jiang
--20cf301d41a00e441e04a776bbcb--