How Convert Decimal Minutes to Minutes and Seconds?
-
TomBrooklyn
- Posts: 26
- Joined: Fri Jan 04, 2013 8:08 am
How Convert Decimal Minutes to Minutes and Seconds?
Win 7
How can I convert minutes given in a whole and decimal number to minutes, seconds, and hundredths of a second?
How can I convert minutes given in a whole and decimal number to minutes, seconds, and hundredths of a second?
Open Office 3.4.1 on Windows 7 Pro
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: How Convert Decimal Minutes to Minutes and Seconds?
If your minutes are in cell A1
Minutes
Seconds
hundredths
Note that if you divide the number by 1440 = 24*60, you can format the result as MM:SS.00 to display all the stuff in one cell (this works for minutes < 60).
Minutes
Code: Select all
=INT(A1)Code: Select all
=INT(60*(A1-INT(A1)))Code: Select all
=100*(60*(A1-INT(A1))-INT(60*(A1-INT(A1))))Apache OpenOffice 4.1.1
Windows XP
Windows XP
-
TomBrooklyn
- Posts: 26
- Joined: Fri Jan 04, 2013 8:08 am
Re: How Convert Decimal Minutes to Minutes and Seconds?
I'm sorry. I don't understand your reply. What am I supposed to do with the code you show? Where am I supposed to put it?
Open Office 3.4.1 on Windows 7 Pro
Re: How Convert Decimal Minutes to Minutes and Seconds?
If necessary, edit the formulas to get the correct cell address for your decimal minutes (change every occurrence of "A1" if the number is in a different cell)TomBrooklyn wrote:I'm sorry. I don't understand your reply. What am I supposed to do with the code you show? Where am I supposed to put it?
Then put the required formula in whichever cell you need the minutes, seconds, and/or hudredths.
Note that due to limitations in numerical representation, rounding errors may occur with some values. If your calculations have critical impact, always be aware of the limitations of your calculation tools.
If you need the conversion for display purposes only, conversion to number base "days" (by division as Charlie Young explained) and then formatting (directly in the cell or by using the TEXT() function) is better. As far as I can see, that approach won't be vulnerable to rounding errors.
Subsequent calculation should always be based on your original data, not on data thus converted for display purposes.
Also, if you want to display accumulated minutes >=60, put the MM section of the format string in square brackets.
=TEXT(A1/1440;"[MM]:SS.00")
Apache OO 4.1.16 and LibreOffice 25.8, mostly on Ms Windows 10 and 11.
Re: How Convert Decimal Minutes to Minutes and Seconds?
Here's a sample you can study to see how the formulas fit together. Download the attached document and open in Calc. Enter a time and see how the breakout values you want are calculated.
- Attachments
-
- time_breakout_sample.ods
- (10.79 KiB) Downloaded 525 times
AOO4/LO5 • Linux • Fedora 23
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: How Convert Decimal Minutes to Minutes and Seconds?
I think Keme has already explained this (and thanks for the [MM] trick, I had forgotten that!), but the formulas themselves maybe could use some further discussion, and improvement.TomBrooklyn wrote:I'm sorry. I don't understand your reply. What am I supposed to do with the code you show? Where am I supposed to put it?
Let's use a simple example. Suppose A1 contains
Code: Select all
15.7565Code: Select all
=INT(A1)Code: Select all
=A1-INT(A1).75 is ¾ of a minute of course (i.e., 45 = 60 * .75 seconds), so for the whole number of seconds
Code: Select all
=INT(60*(A1-INT(A1)))So we take our original fraction portion (.7565), multiply it by 60 to convert it to seconds and fractions of a second, then subtract off the seconds we got above
Code: Select all
=60*(A1-INT(A1))-INT(60*(A1-INT(A1)))Code: Select all
=100*(60*(A1-INT(A1))-INT(60*(A1-INT(A1))))Code: Select all
A1-INT(A1)Code: Select all
=MOD(A1;1)Code: Select all
=INT(60*MOD(A1;1))Code: Select all
=100*(60*MOD(A1;1)-INT(60*MOD(A1;1)))Apache OpenOffice 4.1.1
Windows XP
Windows XP