minutes between two times

S

Steve

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
 
J

Jon Peltier

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/
_______
 
R

Rob van Gelder

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

Jon Peltier

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/
_______
 
Top