KC011

New Member
Joined
Nov 11, 2017
Messages
1
Hello learned folk.
I have been given large files with a consistent format for the date/time of an observation as follows: " 08.03.2008, 23:00:00.000". There are thousands of date/times in a single column and what I want to do is calculate the time interval between successive observations. As it happens the second observation in the next row is "09.03.2008, 04:00:00.000" so the calculated time in hh:mm ought to be 05:00.
Issues - the format of the cell doesn't seem to be a date/time and I don't know how to convert. When I check format it is just "general" rather than date. I'm sure I can use formula to calculate the time interval if I can do a mass conversion of the date/time format from the nonsense it is into something - which it should be : dd/mm/yyyy hh:mm ! Any thoughts (btw there are many thousands of rows of dates and times and I need time intervals between all successive time/dates...?

Cheers
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hello KC011, welcome to MrExcel

To convert with a formula try this formula in B2 for a date/time in A2

=REPLACE(REPLACE(REPLACE(A2,3,1,"/"),6,1,"/"),11,1,"")+0

Format as required - e.g. dd/mm/yyyy hh:mm:ss.000 - then copy down column
 
Last edited:
Upvote 0
Select the range, press ctrl+H (Find and Replace), set Find What to period ( . ) and Replace With to slash ( / ), then click Replace All.

Format the range as Custom dd/mm/yyyy hh:mm:ss.000 .
 
Upvote 0
Select the range, press ctrl+H (Find and Replace), set Find What to period ( . ) and Replace With to slash ( / ), then click Replace All.

Format the range as Custom dd/mm/yyyy hh:mm:ss.000 .

but won't that change 08.03.2008, 23:00:00.000 to 08/03/2008, 23:00:00/000?
 
Upvote 0

Forum statistics

Threads
1,215,090
Messages
6,123,061
Members
449,091
Latest member
ikke

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