From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: dates in a spreadsheet Date: Wed, 17 Mar 2010 18:39:43 -0400 Message-ID: <87ocimtvww.fsf@gollum.intra.norang.ca> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ns1vZ-00006j-4F for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 18:41:25 -0400 Received: from [140.186.70.92] (port=37704 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns1uf-0006rE-QO for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 18:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ns1u3-0001mA-Ce for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 18:39:53 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:62077) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ns1u3-0001m6-As for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 18:39:51 -0400 In-Reply-To: <3a257d511003171345l631fcf37ic425a9d4904f402a@mail.gmail.com> (Josh Mattoon's message of "Wed\, 17 Mar 2010 13\:45\:51 -0700") 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: Josh Mattoon Cc: Dan Davison , emacs-orgmode@gnu.org Josh Mattoon writes: > Hey Nick, the first one came through just fine. This is pretty cool but s= till not quite what I'm looking for. =C2=A0It totally helped me get what I = wanted though! =C2=A0I wanted to have a separate row for each day > so I could fill in activities. =C2=A0Modifying your example I get:=C2=A0 > > | date =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | place =C2=A0 | activit= y =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| notes =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| > |------------------+---------+---------------------------+---------------= ---| > | <2010-03-19 Fri> | =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 | dum= my =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| > | <2010-03-20 Sat> | =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| > | <2010-03-21 Sun> | moon =C2=A0 =C2=A0| collect rocks =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| > | <2010-03-22 Mon> | jupiter | thrash around the red dot | =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| > | <2010-03-23 Tue> | mars =C2=A0 =C2=A0| see the little green men =C2=A0|= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| > | <2010-03-24 Wed> | earth =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 | home, sweet home | > #+TBLFM: @2$1 =3D <03-19-2010>::$1 =3D @-1$1 + 1 > > Exactly what I wanted! =C2=A0I can insert days, move them around, and jus= t hit C-u C-c C-c to have it update. =C2=A0I'd like to understand how it wo= rks though, if you don't mind. =C2=A0What does the ::$1 synax mean? =C2=A0A= nd > 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 =3D <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 =3D @-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. HTH, Bernt