emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Some problems with times in a spreadsheet
@ 2010-07-21 10:33 Cecil Westerhof
  2010-07-21 13:46 ` Juan
  0 siblings, 1 reply; 6+ messages in thread
From: Cecil Westerhof @ 2010-07-21 10:33 UTC (permalink / raw)
  To: emacs-orgmode

I have the following table:
|---+-------------+------------+------------|
|   |         Day | ProjectA   | ProjectB   |
|---+-------------+------------+------------|
|   |          14 | 1@ 00'     | 1@ 45'     |
|   |          15 | 0@ 30'     | 3@ 35'     |
|   |          16 | 0@ 45'     | 1@ 00'     |
|   |          17 | 3@ 10'     | 2@ 45'     |
|   |          18 | 1@ 55'     | 0@ 35'     |
|   |          19 | 5@ 25'     | 7@ 25'     |
|   |          20 | 3@ 30'     | 1@ 00'     |
|---+-------------+------------+------------|
| # | Total hours | 16@ 15' 0" | 18@ 5' 0"  |
| ^ |             | totalTime1 | totalTime2 |
|---+-------------+------------+------------|
#+TBLFM: $totalTime1=vsum(@-II..@-I); f2 :: $totalTime2=vsum(@-II..@-I); f2

The string '0 @ 30' says that there were 0 hours and 30 minutes.

I have several problems here.

First of all I would like to see 16.25 instead of 16@ 15' 0". Is this
possible?

Secondly I have to define the formula for each project. In this case
there are only two, but when there are fifteen then it becomes a pain.
Is there a way to use just one formula?

When displaying with minutes instead of as a floating point number, is
it possible to display it without seconds? Instead of 16@ 15' 0" I would
like to get 16@ 15'.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some problems with times in a spreadsheet
  2010-07-21 10:33 Some problems with times in a spreadsheet Cecil Westerhof
@ 2010-07-21 13:46 ` Juan
  2010-07-22  7:14   ` Cecil Westerhof
  0 siblings, 1 reply; 6+ messages in thread
From: Juan @ 2010-07-21 13:46 UTC (permalink / raw)
  To: Cecil Westerhof; +Cc: emacs-orgmode

On Wed, Jul 21, 2010 at 12:33:42PM +0200, Cecil Westerhof wrote:
> | # | Total hours | 16@ 15' 0" | 18@ 5' 0"  |
> | ^ |             | totalTime1 | totalTime2 |
> |---+-------------+------------+------------|
> #+TBLFM: $totalTime1=vsum(@-II..@-I); f2 :: $totalTime2=vsum(@-II..@-I); f2

> First of all I would like to see 16.25 instead of 16@ 15' 0". Is this
> possible?

Calc's "deg" function does this.

use deg(vsum(...)) in the formulas

Regards,
.j.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some problems with times in a spreadsheet
  2010-07-21 13:46 ` Juan
@ 2010-07-22  7:14   ` Cecil Westerhof
  2010-07-22  8:43     ` Andreas Burtzlaff
  0 siblings, 1 reply; 6+ messages in thread
From: Cecil Westerhof @ 2010-07-22  7:14 UTC (permalink / raw)
  To: emacs-orgmode

Op woensdag 21 jul 2010 15:46 CEST schreef Juan:

>> | # | Total hours | 16@ 15' 0" | 18@ 5' 0"  |
>> | ^ |             | totalTime1 | totalTime2 |
>> |---+-------------+------------+------------|
>> #+TBLFM: $totalTime1=vsum(@-II..@-I); f2 :: $totalTime2=vsum(@-II..@-I); f2
>
>> First of all I would like to see 16.25 instead of 16@ 15' 0". Is this
>> possible?
>
> Calc's "deg" function does this.
>
> use deg(vsum(...)) in the formulas

That works. Thanks. I should learn calc. ;-}

I now have (I already made changes):
    |---+-------------+--------------+--------------|
    | # | Total hours | 14.00        | 6.00         |
    | ^ |             | totalTime1   | totalTime2   |
    |   | Hourly rate | 40           | 50           |
    | ^ |             | hourRate1    | hourRate2    |
    | # |  To declare | 560.00       | 300.00       |
    | ^ |             | declaration1 | declaration2 |
    |---+-------------+--------------+--------------|
    #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 :: $totalTime2=deg(vsum(@-II..@-I)); f2 :: $declaration1=$totalTime1*$hourRate1; f2 :: $declaration2=$totalTime2*$hourRate2; f2

This works. One strange thing (not important I think, but I mention
it), I needed to recalculate twice. The first time the 'Total hours'
was displayed correctly, only the second time 'To declare' was
displayed correctly.

I have two formula's that I have to write for every column, I still
would like to now if there is a way to only write them once.

I am not very happy with the long line of formula's. Especially when I
have to repeat formula's. Would something like this be possible?
    #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 ::
             $totalTime2=deg(vsum(@-II..@-I)); f2 ::
             $declaration1=$totalTime1*$hourRate1; f2 ::
             $declaration2=$totalTime2*$hourRate2; f2

This would at least make updating repeating formula's easier and
easier to check.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some problems with times in a spreadsheet
  2010-07-22  7:14   ` Cecil Westerhof
@ 2010-07-22  8:43     ` Andreas Burtzlaff
  2010-07-22  9:23       ` Darlan Cavalcante Moreira
  2010-07-22 11:41       ` Cecil Westerhof
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Burtzlaff @ 2010-07-22  8:43 UTC (permalink / raw)
  To: Cecil Westerhof; +Cc: emacs-orgmode

Cecil Westerhof <cldwesterhof@gmail.com> writes:

> Op woensdag 21 jul 2010 15:46 CEST schreef Juan:
>
>>> | # | Total hours | 16@ 15' 0" | 18@ 5' 0"  |
>>> | ^ |             | totalTime1 | totalTime2 |
>>> |---+-------------+------------+------------|
>>> #+TBLFM: $totalTime1=vsum(@-II..@-I); f2 :: $totalTime2=vsum(@-II..@-I); f2
>>
>>> First of all I would like to see 16.25 instead of 16@ 15' 0". Is this
>>> possible?
>>
>> Calc's "deg" function does this.
>>
>> use deg(vsum(...)) in the formulas
>
> That works. Thanks. I should learn calc. ;-}
>
> I now have (I already made changes):
>     |---+-------------+--------------+--------------|
>     | # | Total hours | 14.00        | 6.00         |
>     | ^ |             | totalTime1   | totalTime2   |
>     |   | Hourly rate | 40           | 50           |
>     | ^ |             | hourRate1    | hourRate2    |
>     | # |  To declare | 560.00       | 300.00       |
>     | ^ |             | declaration1 | declaration2 |
>     |---+-------------+--------------+--------------|
>     #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 :: $totalTime2=deg(vsum(@-II..@-I)); f2 :: $declaration1=$totalTime1*$hourRate1; f2 :: $declaration2=$totalTime2*$hourRate2; f2
>
> This works. One strange thing (not important I think, but I mention
> it), I needed to recalculate twice. The first time the 'Total hours'
> was displayed correctly, only the second time 'To declare' was
> displayed correctly.
>
> I have two formula's that I have to write for every column, I still
> would like to now if there is a way to only write them once.

No, I'm afraid not.

> I am not very happy with the long line of formula's. Especially when I
> have to repeat formula's. Would something like this be possible?
>     #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 ::
>              $totalTime2=deg(vsum(@-II..@-I)); f2 ::
>              $declaration1=$totalTime1*$hourRate1; f2 ::
>              $declaration2=$totalTime2*$hourRate2; f2
>

The formula editor ( C-c ' ) will display the formulas one per line and
make duplicating and changing them much easier.

HTH

Andreas

> This would at least make updating repeating formula's easier and
> easier to check.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Some problems with times in a spreadsheet
  2010-07-22  8:43     ` Andreas Burtzlaff
@ 2010-07-22  9:23       ` Darlan Cavalcante Moreira
  2010-07-22 11:41       ` Cecil Westerhof
  1 sibling, 0 replies; 6+ messages in thread
From: Darlan Cavalcante Moreira @ 2010-07-22  9:23 UTC (permalink / raw)
  To: Andreas Burtzlaff; +Cc: Cecil Westerhof, emacs-orgmode


I always use the formula editor even when I have a single formula. It will
even highlight in the cells in the table related to the construct where the
cursor is in (the region pointed by @-II..@-I, for instance). It also makes
easy to change a cell reference using shift+arrows.

To make it short, it is better to understand the single line below the
table with all formulas as the place where org stores the formulas, and not
the place where you should manually edit them.

--
Darlan

At Thu, 22 Jul 2010 10:43:04 +0200,
Andreas Burtzlaff <andy13@gmx.net> wrote:
> 
> Cecil Westerhof <cldwesterhof@gmail.com> writes:
> 
> > Op woensdag 21 jul 2010 15:46 CEST schreef Juan:
> >
> >>> | # | Total hours | 16@ 15' 0" | 18@ 5' 0"  |
> >>> | ^ |             | totalTime1 | totalTime2 |
> >>> |---+-------------+------------+------------|
> >>> #+TBLFM: $totalTime1=vsum(@-II..@-I); f2 :: $totalTime2=vsum(@-II..@-I); f2
> >>
> >>> First of all I would like to see 16.25 instead of 16@ 15' 0". Is this
> >>> possible?
> >>
> >> Calc's "deg" function does this.
> >>
> >> use deg(vsum(...)) in the formulas
> >
> > That works. Thanks. I should learn calc. ;-}
> >
> > I now have (I already made changes):
> >     |---+-------------+--------------+--------------|
> >     | # | Total hours | 14.00        | 6.00         |
> >     | ^ |             | totalTime1   | totalTime2   |
> >     |   | Hourly rate | 40           | 50           |
> >     | ^ |             | hourRate1    | hourRate2    |
> >     | # |  To declare | 560.00       | 300.00       |
> >     | ^ |             | declaration1 | declaration2 |
> >     |---+-------------+--------------+--------------|
> >     #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 :: $totalTime2=deg(vsum(@-II..@-I)); f2 :: $declaration1=$totalTime1*$hourRate1; f2 :: $declaration2=$totalTime2*$hourRate2; f2
> >
> > This works. One strange thing (not important I think, but I mention
> > it), I needed to recalculate twice. The first time the 'Total hours'
> > was displayed correctly, only the second time 'To declare' was
> > displayed correctly.
> >
> > I have two formula's that I have to write for every column, I still
> > would like to now if there is a way to only write them once.
> 
> No, I'm afraid not.
> 
> > I am not very happy with the long line of formula's. Especially when I
> > have to repeat formula's. Would something like this be possible?
> >     #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 ::
> >              $totalTime2=deg(vsum(@-II..@-I)); f2 ::
> >              $declaration1=$totalTime1*$hourRate1; f2 ::
> >              $declaration2=$totalTime2*$hourRate2; f2
> >
> 
> The formula editor ( C-c ' ) will display the formulas one per line and
> make duplicating and changing them much easier.
> 
> HTH
> 
> Andreas
> 
> > This would at least make updating repeating formula's easier and
> > easier to check.
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some problems with times in a spreadsheet
  2010-07-22  8:43     ` Andreas Burtzlaff
  2010-07-22  9:23       ` Darlan Cavalcante Moreira
@ 2010-07-22 11:41       ` Cecil Westerhof
  1 sibling, 0 replies; 6+ messages in thread
From: Cecil Westerhof @ 2010-07-22 11:41 UTC (permalink / raw)
  To: Andreas Burtzlaff; +Cc: Cecil Westerhof, emacs-orgmode

Op donderdag 22 jul 2010 10:43 CEST schreef Andreas Burtzlaff:

>> I have two formula's that I have to write for every column, I still
>> would like to now if there is a way to only write them once.
>
> No, I'm afraid not.

I have to live with it then.


>> I am not very happy with the long line of formula's. Especially when I
>> have to repeat formula's. Would something like this be possible?
>> #+TBLFM: $totalTime1=deg(vsum(@-II..@-I)); f2 ::
>> $totalTime2=deg(vsum(@-II..@-I)); f2 ::
>> $declaration1=$totalTime1*$hourRate1; f2 ::
>> $declaration2=$totalTime2*$hourRate2; f2
>>
>
> The formula editor ( C-c ' ) will display the formulas one per line and
> make duplicating and changing them much easier.

Works like a charm. Not optimal (I need to enter the formula editor to
check), but good enough.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-22 11:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 10:33 Some problems with times in a spreadsheet Cecil Westerhof
2010-07-21 13:46 ` Juan
2010-07-22  7:14   ` Cecil Westerhof
2010-07-22  8:43     ` Andreas Burtzlaff
2010-07-22  9:23       ` Darlan Cavalcante Moreira
2010-07-22 11:41       ` Cecil Westerhof

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).