emacs-orgmode
[Top][All Lists]

## Re: [Orgmode] Re: dates in a spreadsheet

 From: Carsten Dominik Subject: Re: [Orgmode] Re: dates in a spreadsheet Date: Thu, 18 Mar 2010 06:38:52 +0100

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

```
```Josh Mattoon <address@hidden> 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
```
```
And the magic is that calc understands date and knows how to do
arithmetic with them.

- Carsten

```