From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Re: Can this table formula be done more efficient Date: Mon, 9 Jun 2014 09:04:16 +0200 Message-ID: References: <87tx7vk482.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134aeb4c0664904fb61d189 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wttcw-0005s3-E8 for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 03:04:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wttcu-0006cT-RH for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 03:04:18 -0400 Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:33245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wttcu-0006cO-Lk for emacs-orgmode@gnu.org; Mon, 09 Jun 2014 03:04:16 -0400 Received: by mail-qa0-f43.google.com with SMTP id m5so7458351qaj.16 for ; Mon, 09 Jun 2014 00:04:16 -0700 (PDT) In-Reply-To: <87tx7vk482.fsf@gmail.com> 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-orgmode@gnu.org --001a1134aeb4c0664904fb61d189 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2014-06-08 13:53 GMT+02:00 Nick Dokos : > Cecil Westerhof writes: > > > At the moment I am using the following formula: > > #+TBLFM: @<<$4..@>>$4 =3D $2 - $3 :: @>$2=3Dvsum(@<<$2..@>>$2) :: > @>$3=3Dvsum(@<<$3..@>>$3) :: @>$4=3Dvsum(@<<$4..@>>$4) > > > > This does what I want, but there are two things that could be improved. > > > > - The second, third and fourth formula do exactly the same, only on > different columns. Could this be rewritten to one formula? > > > > --8<---------------cut here---------------start------------->8--- > #+TBLFM: @<<$4..@>>$4 =3D $2 - $3 :: @>$2..$4=3Dvsum(@<<$0..@>>$0) > --8<---------------cut here---------------end--------------->8--- > =E2=80=8BWorks like a charm. Thanks. =E2=80=8B > =E2=80=8B=E2=80=8B > See > =E2=80=8B=E2=80=8B > (info "(org) References") > =E2=80=8BI should study that more diligently. --=20 Cecil Westerhof --001a1134aeb4c0664904fb61d189 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2014= -06-08 13:53 GMT+02:00 Nick Dokos <ndokos@gmail.com>:
Cecil Westerhof <cldwesterhof@gmail.com> writes:

> At the moment I am using the following formula:
> =C2=A0=C2=A0=C2=A0 #+TBLFM: @<<$4..@>>$4 =3D $2 - $3 :: @&= gt;$2=3Dvsum(@<<$2..@>>$2) :: @>$3=3Dvsum(@<<$3..@>= >$3) :: @>$4=3Dvsum(@<<$4..@>>$4)
>
> This does what I want, but there are two things that could be improved= .
>
> - The second, third and fourth formula do exactly the same, only on di= fferent columns. Could this be rewritten to one formula?
>

--8<---------------cut here---------------start------------->8-= --
#+TBLFM: @<<$4..@>>$4 =3D $2 - $3 :: @>$2..$4=3Dvsum(@<&l= t;$0..@>>$0)
--8<---------------cut here---------------end--------------->8---
=

=E2=80=8BWorks like a charm. Thanks.
=
=E2=80=8B
=C2=A0
=E2=80=8B=E2=80=8B
See
=E2=80=8B=E2=80=8B(info "(org) References")

=E2=80=8BI should study that more dilige= ntly.

--
Cecil Westerhof
--001a1134aeb4c0664904fb61d189--