Comparing 12-hour time data

aduval

New Member
Joined
Jul 18, 2003
Messages
17
I want to calculate the amount of time that has passed between the start time and the end time. The data comes from an external database so I have to analyze it in Excel. Here is a sample of the data:

BEGIN_TIME END_TIME
91945 93105
93109 94139
94143 95327
95331 101015
101020 101514
101520 101951
101954 103522
103526 104744
71125 71529
71604 71736

It is in (hhmmss) format but some times are 5 digit numbers and some are 6 digit numbers.

I need a formula that I can put in a third column that will calculate the hhmmss that has passed between the two time values.

Can you help?

Andre
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
If A1 contains 91945 this formula:

=TEXT(A1,"00\:00\:00")+0

will return a true serial time.

To subtract the times you can use:

=TEXT(B1,"00\:00\:00")-TEXT(A1,"00\:00\:00")

formatted as [h]:mm:ss.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,565
Messages
5,765,140
Members
425,263
Latest member
alcat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top