[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Conditional in table formula with times
From: |
Loris Bennett |
Subject: |
[O] Conditional in table formula with times |
Date: |
Fri, 21 Feb 2014 08:49:01 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Hi,
I'm trying to keep track of total time spend at work, but I am having
trouble with a conditional in table formula:
| *Day* | *Came* | *Went* | *Worked* | *Required* | *Diff* |
|------------------+--------+--------+----------+------------+----------|
| [2014-01-06 Mon] | 8:00 | 17:00 | 09:00:00 | 00:00:00 | 09:00:00 |
| [2014-01-07 Tue] | | | 00:00:00 | 00:00:00 | 00:00:00 |
| [2014-01-08 Wed] | 8:10 | 16:30 | 08:20:00 | 00:00:00 | 08:20:00 |
| [2014-01-09 Thu] | 7:55 | 17:05 | 09:10:00 | 00:00:00 | 09:10:00 |
| [2014-01-10 Fri] | 8:00 | 17:05 | 09:05:00 | 00:00:00 | 09:05:00 |
#+TBLFM: $4=$3-$2;T::$5=if($4 > 0,"8:18:00","00:00:00");T::$6=$4-$5;T
Debugging the formula gives me for @2$5:
,---------------------------------------------
| Substitution history of formula
| Orig: if($4 > 0,"8:18:00","00:00:00");T
| $xyz-> if($4 > 0,"8:18:00","00:00:00")
| @r$c-> if($4 > 0,"8:18:00","00:00:00")
| $1-> if((32400) > 0,"8:18:00","00:00:00")
| Result: 00:00:00
| Format: NONE
| Final: 00:00:00
`---------------------------------------------
and for @3$5:
,------------------------------------------
| Substitution history of formula
| Orig: if($4 > 0,"8:18:00","00:00:00");T
| $xyz-> if($4 > 0,"8:18:00","00:00:00")
| @r$c-> if($4 > 0,"8:18:00","00:00:00")
| $1-> if((0) > 0,"8:18:00","00:00:00")
| Result: 00:00:00
| Format: NONE
| Final: 00:00:00
`------------------------------------------
Can anyone enlighten me as to why I get "00:00:00" in the first case?
Cheers,
Loris
--
This signature is currently under construction.
- [O] Conditional in table formula with times,
Loris Bennett <=
Re: [O] Conditional in table formula with times, Eric S Fraga, 2014/02/24