emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Table Formula: Update column, then update value


From: Eric S Fraga
Subject: Re: [O] Table Formula: Update column, then update value
Date: Thu, 11 Sep 2014 15:30:15 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux)

On Thursday, 11 Sep 2014 at 10:00, Tory S. Anderson wrote:
> I have a table that calculates daily cost and then sums the hours and
> the weekly cost. But I can't seem to get a formula that will do the
> former.
>
>   | Date         | Hours | Rate | Cost |
>   |--------------+-------+------+------|
>   | September 8  |  0.50 |    1 |   1. |
>   | September 9  |  2.00 |    1 |   2. |
>   | September 10 |  2.00 |    1 |   2. |
>   | September 11 |  2.00 |    1 |   2. |
>   | September 12 |  2.00 |    1 |   2. |
>   |--------------+-------+------+------|
>   |              |   8.5 |      | 399. |
>   | ^            |   hrs |      |  ttl |
>
>   #+TBLFM: $hrs=vsum(@I..II)::$ttl=vsum(@I..II)
>
> Before the formula above works, I end up pasting the following line
> just below the last date (above the @II line):
>
>   #+TBLFM: $4=vsum($2*$3)

>
> So, I have to copy-paste into the middle of my table, run the line,
> then cut the line back out of the table and run the lower line. I'm
> just sure there's a better way; it even seems like once upon a time I
> had something working. But is there a non-repetitive way to autofill
> the COST ($4) column between @I..II without wiping out everything
> else?

I am not sure what is the problem here.  The above table works fine for
me with this TBLFM line:

    #+TBLFM: $4=$3*$2::$hrs=vsum(@I..II)::$ttl=vsum(@I..II)

What is it you expect?  Note, your September 8 entry for the cost is
wrong... but will get updated if you use this TBLFM line.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-320-gb5c9de

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]