From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Org table: how to reference part of the rows Date: Sun, 17 Dec 2017 15:53:25 +0000 Message-ID: <87vah5fj0q.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQbFs-000834-BP for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 10:53:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQbFp-0004L4-4B for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 10:53:32 -0500 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:44859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQbFo-0004KA-TT for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 10:53:29 -0500 Received: by mail-wr0-x22a.google.com with SMTP id w95so1047579wrc.11 for ; Sun, 17 Dec 2017 07:53:28 -0800 (PST) In-Reply-To: (Qiang Fang's message of "Sat, 16 Dec 2017 19:24:52 +0800") 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" To: Qiang Fang Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Saturday, 16 Dec 2017 at 19:24, Qiang Fang wrote: > The last column is the ratio between column b and a, the last row is > the sum of each row, the second formula only applies from the second > row to the row before last row. The table that doesn't work is: > > | | a | b | ratio | > | | 0.797 | 0.780 | | > | | 0.744 | 0.730 | | > | | 12.707 | 2.384 | | > | sum | 14.248 | 3.114 | 0.92040988 | > | ^ | x | y | | > #+tblfm: $x=3Dvsum(@2..@-1) :: $y=3Dvsum(@3..@-1) > #+tblfm: $4 =3D ($3 / $2) * 100 I cannot help with the OP's question but this table leads to very strange behaviour for me. If I delete the tblfm lines, then go to the location of the x variable (5th row, 2nd column) and type C-u C-c =3D to enter "x=3Dvsum(@2..@i-1)", that is okay. But if I then go to the next column and try to enter the equivalent formula for y, it replaces the previously entered formula for x! If I go back to the x location and re-enter that formula, it replaces the y formula. Further, the formulae created by org are missing the $ in front of the variable, i.e. x=3Dvsum(...) instead of $x=3Dvsum(...). This happens with up to date org from git as of an hour or so ago. For the OP, the formulas =2D-=20 Eric S Fraga via Emacs 27.0.50, Org release_9.1.4-214-ge8b71b --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSPXCedOQfhSlwpVw3IkZPY//z2fQUCWjaS9QAKCRDIkZPY//z2 fbZMAKCHzDjBQHKJ9INsGZqEvi9cJ2hn0QCfRSrqynQl/zQlXCuJFiELgyNDmys= =/QWa -----END PGP SIGNATURE----- --=-=-=--