emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: nicholas.dokos@hp.com
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: formulas in spreadsheet to increase date
Date: Wed, 17 Aug 2011 09:32:17 -0400	[thread overview]
Message-ID: <CAN_Dec94faE43iFn3fdboq7uH2aBBU9Hz+iHpX98budqMWNOFQ@mail.gmail.com> (raw)
In-Reply-To: <21851.1313566517@alphaville.dokosmarshall.org>

[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]

On Wed, Aug 17, 2011 at 3:35 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Matt Price <moptop99@gmail.com> wrote:
>
> > Hi,
> >
> > It's htat time of year again and I'm putting together course syllabi.  I
> would really love to be able
> > to dynamically calculate dates in a spreadsheet, e.g.:
> >
> > |Topic 1|Date1|Description1|
> > |Topic2|Above Date + 7| Description2|
> > |Topic3|Above Date + 7| Description3|
> >
> > Is there a way for me to do that?
>
> As usual in situations like this, you have to start things off with
> a field formula for the first date. The column formula then can be
> used to calculate all the *other* rows (field formulas override column
> formulas - see section 3.5.6, "Column formulas", in the org manual
> or evaluate (info "(org) Column formulas") to get there directly).
>
> | Topic 1 | <2011-08-17 Wed> | Description1 |
> | Topic2  | <2011-08-24 Wed> | Description2 |
> | Topic3  | <2011-08-31 Wed> | Description3 |
> #+TBLFM: @1$2=<2011-08-17> :: $2 = <@-1$2> + 7
>
> The column formula says: get the field from the row above and the same
> column (@-1$2), interpret it as a date (<..>) and add 7 (days) to it.
> The column formula can be simplified to $2 = <@-1> + 7.
>
> If you want to increment by e.g. 10 mins, the increment has to be
> calculated as a fraction of a day:
>
> | Topic 1 | <2011-09-18 Sun 10:20> | Description1 |
> | Topic2  | <2011-09-18 Sun 10:30> | Description2 |
> | Topic3  | <2011-09-18 Sun 10:40> | Description3 |
> #+TBLFM: @1$2=<2011-09-18 10:20> :: $2 = <@-1> + 10*(1/24*60))
>
>
> ah, supercool.  thank you!!

matt

[-- Attachment #2: Type: text/html, Size: 2176 bytes --]

      reply	other threads:[~2011-08-17 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16 23:29 formulas in spreadsheet to increase date Matt Price
2011-08-17  7:35 ` Nick Dokos
2011-08-17 13:32   ` Matt Price [this message]

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=CAN_Dec94faE43iFn3fdboq7uH2aBBU9Hz+iHpX98budqMWNOFQ@mail.gmail.com \
    --to=moptop99@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    /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).