From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Table rows and ranges as LHS of formulas Date: Thu, 3 Mar 2011 00:16:12 +0100 Message-ID: References: <5A22097F-A1F9-480E-B2E5-030CD6493B2F@gmail.com> <4D6E6C4C.4090709@christianmoe.com> <4D6ECE2E.5040504@christianmoe.com> Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=39591 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuvHF-0000HO-26 for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 18:16:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuvHD-0005Lt-U8 for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 18:16:16 -0500 Received: from mail-ew0-f41.google.com ([209.85.215.41]:60545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuvHD-0005Ln-Hp for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 18:16:15 -0500 Received: by ewy10 with SMTP id 10so194259ewy.0 for ; Wed, 02 Mar 2011 15:16:14 -0800 (PST) In-Reply-To: <4D6ECE2E.5040504@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: emacs-orgmode List On 3.3.2011, at 00:09, Christian Moe wrote: > Hi, Carsten, >=20 > Yes, it's really neat. >=20 > I just realized, though, that there *is* an equally clean way to = generate such tables in OOo Calc (which the Org spreadsheet has all but = replaced for my needs): >=20 > - Place 1 in cell B1. Drag across to get 1-10 in cells B1:K1. > - Place 1 in cell A2. Drag down to get 1-10 in cells A2:A11. > - In cell B2, type the formula =3DB1:K1*A2:A11. Do NOT press Enter, = press Ctrl-Shift-Enter (or Cmd-Shift-Enter on Mac) to make it an "array = formula" (it presents as {=3DB1:K1*A2:A11}). > - Hey presto, the table is filled. Indeed, this sounds equally compact. Thanks! - Carsten >=20 > Yours, > Christian >=20 >=20 > On 3/2/11 6:31 PM, Carsten Dominik wrote: >> Hi Christian, >>=20 >> thanks for the great example! I guess this is really something >> Org has over other spreadsheets. No = copy-and-paste-with-modification, > > just a single formula. >>=20 >> - Carsten >>=20 >> On 2.3.2011, at 17:11, Christian Moe wrote: >>=20 >>> Hi, >>>=20 >>> Row formulas are great! I've missed this, but learned to work around = it, since I I just assumed that if you hadn't already done it, it was = not a reasonable thing to ask for. >>>=20 >>> Testing... So now we can simply do e.g.: >>>=20 >>> #+CAPTION: A multiplication table >>> | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | >>> |----+---+---+---+---+---+---+---+---+---+----| >>> | 1 | | | | | | | | | | | >>> | 2 | | | | | | | | | | | >>> | 3 | | | | | | | | | | | >>> | 4 | | | | | | | | | | | >>> | 5 | | | | | | | | | | | >>> | 6 | | | | | | | | | | | >>> | 7 | | | | | | | | | | | >>> | 8 | | | | | | | | | | | >>> | 9 | | | | | | | | | | | >>> | 10 | | | | | | | | | | | >>> #+TBLFM: @2$2..@11$11=3D@1*$1 >>>=20 >>> C-c C-c...and hey presto: >>>=20 >>> #+CAPTION: A multiplication table >>> | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | >>> |----+----+----+----+----+----+----+----+----+----+-----| >>> | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | >>> | 2 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | >>> | 3 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 | >>> | 4 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | >>> | 5 | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | >>> | 6 | 6 | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 | >>> | 7 | 7 | 14 | 21 | 28 | 35 | 42 | 49 | 56 | 63 | 70 | >>> | 8 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | >>> | 9 | 9 | 18 | 27 | 36 | 45 | 54 | 63 | 72 | 81 | 90 | >>> | 10 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | >>> #+TBLFM: @2$2..@11$11=3D@1*$1 >>>=20 >>>=20 >>> Yours, >>> Christian >>>=20 >>> On 3/1/11 3:28 PM, Carsten Dominik wrote: >>>> Hi everyone, >>>>=20 >>>> A frequently requested feature for tables has been to >>>> be able to define row formulas in a way similar to column >>>> formulas. The patch below allows things like >>>>=20 >>>> @3=3D >>>> @2$2..@5$7=3D >>>> @I$2..@II$4=3D >>>>=20 >>>> as the left hand side for table formulas in order to >>>> write a formula that is valid for an entire column or >>>> for a rectangular section in a table. >>>>=20 >>>> Note that in contrast to column formulas, @3=3D will not >>>> automatically skip a "header column" or field formulas in the >>>> same row. In fact, making both a range formula and a field >>>> point to the same field is forbidden and throws an error. >>>> So to have a formula apply to all but the first column, use >>>> something like this: >>>>=20 >>>> @3$2..@3$8=3D.... >>>>=20 >>>> Testing is welcome, but I am confident that this works >>>> pretty well. >>>>=20 >>>> Bastien, please let me know if you want to have this integrated >>>> before the release, then I will do so. >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> _______________________________________________ >>>> Emacs-orgmode mailing list >>>> Please use `Reply All' to send replies to the list. >>>> Emacs-orgmode@gnu.org >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>>=20 >>=20 >>=20 >=20 -- Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode