Convert seconds to time format

Discuss the spreadsheet application
Post Reply
Tom George
Posts: 1
Joined: Fri May 22, 2009 8:37 pm

Convert seconds to time format

Post by Tom George »

I am trying to convert handicaps in seconds (e.g. 149) into time format (i.e. 2:29) in order to calculate the handicapped race results. I have checked the help entries for TIME, SECOND, DEGREE and CONVERT and have set the cell format to MM:SS but none of this works. Does anyone know a way to do this?

My system is Debian (Lenny, stable) for which the current Openoffice release is 2.4.1

I am attaching an example of the spreadsheet.
Attachments
handicaping.ods
(14.52 KiB) Downloaded 366 times
OOo 2.4.X on PCLinuxOS + none
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: convert seconds to time format

Post by TheGurkha »

Hi and welcome to the forums.

There may be other ways, but this worked with your data. using the values out of your first column I can convert them as so:

128 02:08
147 02:27
193 03:13
etc.

Format the cells as Time, MM:SS as you are doing. In the I copied the first column to a new location in your example sheet. The 128 value is in B21. In C21 I put: =TIME(0;QUOTIENT(B21;60);MOD(B21;60)) and then copied that down the rest of the C column.

See the attached sheet.
TheGurkha - Handicapping.ods
Modded Sheet
(15.95 KiB) Downloaded 673 times
If this has answered your question please go to your first post and use the Edit button, and add [Solved] to the start of the title. You can use the green tick icon at the same time if you like.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: convert seconds to time format

Post by acknak »

Since spreadsheet times are just fractions of a day, you can convert seconds to a spreadsheet time by dividing by the number of seconds per day: 60*60*24, or 86400. Just format the result as MM:SS, or [M]:SS.
AOO4/LO5 • Linux • Fedora 23
Post Reply