| View previous topic :: View next topic |
| Author |
Message |
T-buch General User

Joined: 04 Mar 2009 Posts: 12 Location: Danmark (Denmark), København
|
Posted: Wed Feb 16, 2011 1:41 pm Post subject: Minus 25 sec from a timecode |
|
|
I got a value written in the code [TT]:MM:SS,00 for instance: 00:00:30,08
I want to minus 25 sec from that value so the result should be 00:00:05,08
How can I do that? _________________ Thomas Buch |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Wed Feb 16, 2011 1:56 pm Post subject: |
|
|
-25/24/60/60
Calc works on time as a number and decimal fraction of days. _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
T-buch General User

Joined: 04 Mar 2009 Posts: 12 Location: Danmark (Denmark), København
|
Posted: Wed Feb 16, 2011 2:28 pm Post subject: |
|
|
Thanks
But I cannot figure it out how I should understand the "format code": "25/24/60/60 "
first you take 25 seconds, then 24 hours, then 60 minutes and at last 60 seconds
- why is it not:
-24/60/85??? I
If you want to minus (or add) 25 minutes from the value in stead - how do you do that? _________________ Thomas Buch |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2474 Location: 3rd Rock From The Sun
|
Posted: Wed Feb 16, 2011 2:51 pm Post subject: |
|
|
Thomas Buch:
Let us assume your TIME value is in cell A2 . . . the following formula will provide the result you want:
| Code: | | =TIME(HOUR(A2); MINUTE(A2); SECOND(A2) - 25) |
Explanation: Using the TIME function, will return the HOUR, MINUTE and SECOND from the original cell, and, subtract 25 from the SECOND portion . . . per your description.
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
T-buch General User

Joined: 04 Mar 2009 Posts: 12 Location: Danmark (Denmark), København
|
Posted: Thu Feb 17, 2011 2:57 am Post subject: |
|
|
Yes thanks, Sliderule - This is easy to understand - but i would also love to understand what is happening in post 2 by Robert Tucker - so I allow myself to wait a little more before adding a "Solved" hoping he or another will explain _________________ Thomas Buch |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Feb 17, 2011 3:53 am Post subject: |
|
|
All dates and times in all spreadsheets are formatted numbers in unit "Days".
You may read any old book on spreadsheets, even 20 year old books, where all this is explained in depth.
You add 5 to a number in order to add 5 days.
You add 5/24 to a number in order to add 5 hours.
You add 5/24/60 to a number in order to add 5 minutes. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
|