Next: , Previous: , Up: The spreadsheet   [Contents][Index]

3.5.4 Durations and time values

If you want to compute time values use the T, t, or U flag, either in Calc formulas or Elisp formulas:

  |  Task 1 |   Task 2 |    Total |
  |    2:12 |     1:47 | 03:59:00 |
  |    2:12 |     1:47 |    03:59 |
  | 3:02:20 | -2:07:00 |     0.92 |
  #+TBLFM: @2$3=$1+$2;T::@3$3=$1+$2;U::@4$3=$1+$2;t

Input duration values must be of the form HH:MM[:SS], where seconds are optional. With the T flag, computed durations will be displayed as HH:MM:SS (see the first formula above). With the U flag, seconds will be omitted so that the result will be only HH:MM (see second formula above). Zero-padding of the hours field will depend upon the value of the variable org-table-duration-hour-zero-padding.

With the t flag, computed durations will be displayed according to the value of the option org-table-duration-custom-format, which defaults to 'hours and will display the result as a fraction of hours (see the third formula in the example above).

Negative duration values can be manipulated as well, and integers will be considered as seconds in addition and subtraction.