0

I would like to calculate the time in this table:

| Start                 | End                   |       Sum | Second Sum |
|-----------------------+-----------------------+-----------+------------|
| [2021-03-12 Fr 10:00] | [2021-03-12 Fr 11:00] | 3599.9424 |      00:59 |
#+TBLFM: $3=($2-$1)*24*60*60::$4=$3;U

The ;U flag to format the value as time only works if I save the result in a temporary column (also there is one second missing somehow).

I would like to calculate the time in one step, but it does not work for me:

| Start                 | End                   |   Sum | Second Sum |
|-----------------------+-----------------------+-------+------------|
| [2021-03-12 Fr 10:00] | [2021-03-12 Fr 11:00] | 00:00 | #ERROR     |
#+TBLFM: $3=($2-$1)*24*60*60;U::$4=$3

How can I find out what is wrong here?

2
  • 1
    The conversions that Org mode does when evaluating formulas in a table are, to say the least, arcane. The best advice I can offer is that whenever Org mode seems obstreperous, you write a lisp function to do the evaluation, the way you want it. See e.g emacs.stackexchange.com/questions/46859/…, – NickD Mar 12 at 14:05
  • Thank you for the assessment, Nick! This will go right on to my TODO-list as I have just stared to learn writing functions in elisp. Do you know if a change in this matter is on the roadmap of org-mode devs? – breathe_in_breathe_out Mar 13 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.