From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: dates in a spreadsheet Date: Thu, 18 Mar 2010 06:38:52 +0100 Message-ID: <8FB819E1-B945-41A1-9B27-2532C014E6AC@gmail.com> References: <3a257d511003162304o7eea96b4u40c581bb3bd69521@mail.gmail.com> <87eijjynnm.fsf@stats.ox.ac.uk> <3a257d511003170951q342b2165vdcc51391c4277911@mail.gmail.com> <11255.1268855898@alphaville.usa.hp.com> <3a257d511003171345l631fcf37ic425a9d4904f402a@mail.gmail.com> <87ocimtvww.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ns9iW-00085T-Pe for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:28 -0400 Received: from [140.186.70.92] (port=53918 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns9iU-00083y-7R for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ns9iR-0002ab-H9 for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:26 -0400 Received: from mail-ew0-f227.google.com ([209.85.219.227]:62046) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ns9iR-0002Yu-3s for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:23 -0400 Received: by mail-ew0-f227.google.com with SMTP id 27so1039911ewy.14 for ; Thu, 18 Mar 2010 00:00:22 -0700 (PDT) In-Reply-To: <87ocimtvww.fsf@gollum.intra.norang.ca> 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: Bernt Hansen Cc: Dan Davison , emacs-orgmode@gnu.org On Mar 17, 2010, at 11:39 PM, Bernt Hansen wrote: > Josh Mattoon writes: > >> Hey Nick, the first one came through just fine. This is pretty cool >> but still not quite what I'm looking for. It totally helped me get >> what I wanted though! I wanted to have a separate row for each day >> so I could fill in activities. Modifying your example I get: >> >> | date | place | activity | >> notes | >> |------------------+---------+--------------------------- >> +------------------| >> | <2010-03-19 Fri> | | | >> dummy | >> | <2010-03-20 Sat> | | >> | | >> | <2010-03-21 Sun> | moon | collect rocks >> | | >> | <2010-03-22 Mon> | jupiter | thrash around the red dot >> | | >> | <2010-03-23 Tue> | mars | see the little green men >> | | >> | <2010-03-24 Wed> | earth | | home, >> sweet home | >> #+TBLFM: @2$1 = <03-19-2010>::$1 = @-1$1 + 1 >> >> Exactly what I wanted! I can insert days, move them around, and >> just hit C-u C-c C-c to have it update. I'd like to understand how >> it works though, if you don't mind. What does the ::$1 synax >> mean? And >> how did it know that we were dealing with a date? > > As I understand it > > This is a formula line with 2 formulas in it. The formulas are > separated by the :: > > @2$1 = <03-19-2010> sets the cell at row 2, column 1 to Mar 19, 2010 > > Then the next formula just calculates all of the values for column 1 > leaving the static entry previously defined alone. > > $1 = @-1$1 + 1 column 1 entries are the previous row for column 1 > plus 1 > > so it just adds 1 to the initial value of the date for each following > row in your table. And the magic is that calc understands date and knows how to do arithmetic with them. - Carsten