ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   minutes between two times (https://www.excelbanter.com/excel-programming/298383-minutes-between-two-times.html)

Steve[_42_]

minutes between two times
 
Can anyone exmaplin how to find the number of minutes between two times.
These times are in the format hh:mm:ss. whenever I try to format(nTime,"mm")
it allways gives me the hour not the minute.
Thanks



Jon Peltier[_7_]

minutes between two times
 
Steve -

Subtract the smaller time from the larger, and multiply the difference
by 1440 (60 min/hours x 24 hours/day). Excel stores times as fractions
of a day: 24 hours = 1.0.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Steve wrote:

Can anyone exmaplin how to find the number of minutes between two times.
These times are in the format hh:mm:ss. whenever I try to format(nTime,"mm")
it allways gives me the hour not the minute.
Thanks




Rob van Gelder[_4_]

minutes between two times
 
Just be careful when the date window covers midnight. The smaller time might
not be earlier.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jon Peltier" wrote in message
...
Steve -

Subtract the smaller time from the larger, and multiply the difference
by 1440 (60 min/hours x 24 hours/day). Excel stores times as fractions
of a day: 24 hours = 1.0.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Steve wrote:

Can anyone exmaplin how to find the number of minutes between two times.
These times are in the format hh:mm:ss. whenever I try to

format(nTime,"mm")
it allways gives me the hour not the minute.
Thanks






Jon Peltier[_7_]

minutes between two times
 
Rob -

Good point. That's why I always save the time with the date. In some
work I did with a previous employer, there was only a time column
without any date (the previous programmer was a dolt). I would insert a
column and stick in a formula that incremented the time by 1 if it was
less than the first time in the column. Since most processes ran shorter
than 24 hours, this was okay.

I just finished another job in which the client didn't understand
Excel's dates and times. He'd programmed his equipment to break up the
time into three columns: Date, Time, and milliseconds. I showed him how
to use custom number formats, especially "yyyy/mm/dd hh:mm:ss.000".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Rob van Gelder wrote:

Just be careful when the date window covers midnight. The smaller time might
not be earlier.




All times are GMT +1. The time now is 04:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com