Difference in military time - unformatted source data

DG1215

New Member
Joined
Jan 11, 2018
Messages
2
[FONT=&quot]I have a set of source data, where the time in a given cell reads like this: “07JAN18 1100”[/FONT][FONT=&quot]. I am trying to come up with a formula that will give me the difference between 2 of these times in [H]:MM.[/FONT][FONT=&quot] Please see examples below. I am trying to achieve column C with a formula. Columns A and B are the source data.[/FONT]

[FONT=&quot]
I would like to be able to achieve this in as few steps as possible. I am aware that I might have to use text to columns to break up the source data, but an automated formula is preferred as I will be importing the data several times a week for the foreseeable future. Any input is greatly appreciated!

[/FONT]
ABC
07JAN18 110008JAN18 1428
27:28
05JAN18 053005JAN18 1541
10:11
06JAN18 131008JAN18 131148:01

<colgroup><col><col><col></colgroup><tbody>
</tbody>
[FONT=&quot]
[/FONT]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi, welcome to the forum!

Assuming the values are text, you could try this. Note: you will need to custom format the cells that contain the formula as [hh]:mm:ss


Excel 2013/2016
ABC
107JAN18 110008JAN18 142827:28:00
205JAN18 053005JAN18 154110:11:00
306JAN18 131008JAN18 131148:01:00
Sheet1
Cell Formulas
RangeFormula
C1=REPLACE(B1,11,0,":")-REPLACE(A1,11,0,":")
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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
Back
Top