[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?
- Subject: Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?
- From: Remy Gauthier <firstname.lastname@example.org>
- Date: Fri, 17 Jul 2020 11:13:57 -0400
- To: Luuk <email@example.com>, firstname.lastname@example.org, Gilles <email@example.com>
If it's just showing, using a numbers format defined as [m] ("m"
between square brackets) will do the job. Since it is time, there
should be no decimal minutes to show and this format should work out.
Using this format will also allow you to continue making operations
with the time values without having to think about the units of what
you are manipulating. And if you want to show seconds, [s] is the
format to use.
As a side note, the "time" format of Calc is days (the value 1 is
equivalent to 24 hours), so multiplying the time value by 24 will give
you decimal hours, multiplying the time value by 24*60 will give
minutes, and by 24*60*60 will give seconds. Once you have the number
you can use standard decimal number formats will display whatever units
you want to use with the number of decimal places you are looking for.
You can also go the other way: to encode, say, 7 hours and 41 minutes,
use this formula: =(7+41/60)/24.
I hope this helps.
Le vendredi 17 juillet 2020 à 15:50 +0200, Luuk a écrit :
> On 17-7-2020 14:37, Gilles wrote:
> > Hello,
> > I have a spreadsheet where time is formatted as HHhMM.
> > In the next column, I'd like to show this in minutes. What would be
> > a goodway to achieve this?
> > Thank you.
> > https://i.postimg.cc/qRKCK14F/image.png
> > --Sent from:
> > http://document-foundation-mail-archive.969070.n3.nabble.com/Users-f1639498.html
> if A2 = "01h14"
> Then the formula: =TIMEVALUE(REPLACE(A2;3;1;":"))*24*60
> Will return: 74
> Basically first replace 'h' for an ':'
> timevalue returns the minutes since midnight.
To unsubscribe e-mail to: firstname.lastname@example.org
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
|[libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?||Gilles <email@example.com>|
|Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?||Luuk <firstname.lastname@example.org>|
- Prev by Date: Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?
- Next by Date: Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?
- Previous by thread: Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?
- Next by thread: Re: [libreoffice-users] [Calc] Good way to turn hours+minutes into minutes?