I am using OOo.calc and I have a cell which is the result of the difference of two "Date and Time" cells. The result is the correct time interval 01:22 (hours and minutes).
I need to convert this to a number of minutes (ie 82).
Ultimately I expect longer time intervals of hours or even days and I shall need to convert these as well.
I have searched everywhere but cannot find any way to do the apparantly simple conversion from hours to minutes let alone hours or days.
Can anyone help please?
DaveOR
[Solved] Converting time values
[Solved] Converting time values
Last edited by DaveOR on Tue Mar 15, 2011 5:33 pm, edited 1 time in total.
Open Office 3.1.1
Windows 7 64bit
Windows 7 64bit
Re: Converting time values
Hours =A1*24
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- MrProgrammer
- Moderator
- Posts: 5468
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Converting time values
Select the cell containing the time interval, use Format, Cells, Numbers, and enter [MM] for the Format code. Enter the brackets as shown.
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Converting time values
Thanks for the prompt response but unfortuneately it doesn't do quite what I want.
I didn't make it clear that I need to use the result in further calculations - in this case to work out consumption in litres per hour.
The number displayed (82) is only a change of format and not an actual number I can use to calculate with (as far as I can see)
This is what I am ultimately trying to do.
I have measured a time interval by having A1 as start time and B1 as stop time.
I make C1 = B1-A1 which generates the time interval (in this case 1hr 22 mins).
I also measure oil consumption in litres over this period and put result in (say) D1 - in this case 30 litres.
I want to calculate consumption in litres/hour.
If I just do a simple equation (D1/C1) I get an eroneous answer of 526.83 instead of 21.95 which is the correct answer.
Any ideas?
Thanks again
DaveOR
I didn't make it clear that I need to use the result in further calculations - in this case to work out consumption in litres per hour.
The number displayed (82) is only a change of format and not an actual number I can use to calculate with (as far as I can see)
This is what I am ultimately trying to do.
I have measured a time interval by having A1 as start time and B1 as stop time.
I make C1 = B1-A1 which generates the time interval (in this case 1hr 22 mins).
I also measure oil consumption in litres over this period and put result in (say) D1 - in this case 30 litres.
I want to calculate consumption in litres/hour.
If I just do a simple equation (D1/C1) I get an eroneous answer of 526.83 instead of 21.95 which is the correct answer.
Any ideas?
Thanks again
DaveOR
Open Office 3.1.1
Windows 7 64bit
Windows 7 64bit
Re: Converting time values
Hours =(B1-A1)*24
526.83/21.95 = 24f I just do a simple equation (D1/C1) I get an eroneous answer of 526.83 instead of 21.95 which is the correct answer.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Converting time values
The answer is already given above. Elaborating might make it clearer (or not...):
In spreadsheets, all times are stored as a single numeric value. Subdivision to days/hours/minutes/seconds is done by formatting, either implicitly (when the software sees that cell input is formatted as time value), or explicitly (format - cells - time). Regardless of formatting, the single value remains (and is the value used for calculations). Hence, conversion between different time units is done by a simple multiplication.
Villeroy's formulas are based on the fact that spreadsheet time values use "day" as the unit. Hence, to calculate hourly values/rates/etc., you have to multiply the time data by 24. Simple unit change (from unit "days" to unit "hours"). To have minutes, multiply by 1440 (24*60).
Clear as milk, no?
In spreadsheets, all times are stored as a single numeric value. Subdivision to days/hours/minutes/seconds is done by formatting, either implicitly (when the software sees that cell input is formatted as time value), or explicitly (format - cells - time). Regardless of formatting, the single value remains (and is the value used for calculations). Hence, conversion between different time units is done by a simple multiplication.
Villeroy's formulas are based on the fact that spreadsheet time values use "day" as the unit. Hence, to calculate hourly values/rates/etc., you have to multiply the time data by 24. Simple unit change (from unit "days" to unit "hours"). To have minutes, multiply by 1440 (24*60).
Clear as milk, no?
Apache OO 4.1.16 and LibreOffice 25.8, mostly on Ms Windows 10 and 11.
Re: Converting time values
Hooray!
I knew it had to be something like this.
I have beed trying everything except 24!!
It is obvious now you have explained it - my error was to assume I should be either multiplying or dividing by 60 to convert hours into minutes. It didn't occur to me that the basic unit was the day and not the hour.
Thanks again
DaveOR

I knew it had to be something like this.
I have beed trying everything except 24!!
It is obvious now you have explained it - my error was to assume I should be either multiplying or dividing by 60 to convert hours into minutes. It didn't occur to me that the basic unit was the day and not the hour.
Thanks again
DaveOR
Open Office 3.1.1
Windows 7 64bit
Windows 7 64bit