emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: Dan Davison <davison@stats.ox.ac.uk>, emacs-orgmode@gnu.org
Subject: Re: Re: dates in a spreadsheet
Date: Thu, 18 Mar 2010 06:38:52 +0100	[thread overview]
Message-ID: <8FB819E1-B945-41A1-9B27-2532C014E6AC@gmail.com> (raw)
In-Reply-To: <87ocimtvww.fsf@gollum.intra.norang.ca>


On Mar 17, 2010, at 11:39 PM, Bernt Hansen wrote:

> Josh Mattoon <joshmattoon@gmail.com> 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

  reply	other threads:[~2010-03-18  7:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  6:04 dates in a spreadsheet Josh Mattoon
2010-03-17 15:18 ` Mikael Fornius
2010-03-17 15:26 ` Dan Davison
2010-03-17 16:51   ` Josh Mattoon
     [not found]     ` <11255.1268855898@alphaville.usa.hp.com>
2010-03-17 20:45       ` Josh Mattoon
2010-03-17 22:39         ` Bernt Hansen
2010-03-18  5:38           ` Carsten Dominik [this message]
2010-03-18 20:31     ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8FB819E1-B945-41A1-9B27-2532C014E6AC@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=bernt@norang.ca \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).