Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
sp
 
Posts: n/a
Default how to find time difference between timestamps to a millisecond?

I have two columns which contain timestamps in the format of yyyy-mm-dd
hh:mm:ss:msmsms (the last three digits are the milliseconds). I need to find
the difference of the timestamps in ss:msmsms format.

I am trying to implement a VB function to do this as there is no predefined
function available. Can anyone please assist?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Bernard Liengme
 
Posts: n/a
Default how to find time difference between timestamps to a millisecond?

If you have date/time in exactly that format (ie 05 for fifth month not just
5) then this formula will convert your data to Excel's date/time format
=DATE(LEFT(A1,4),MID(A1,6,2),MID(A1,9,2))+TIME(MID (A1,12,2),MID(A1,15,2),MID(A1,18,2))+RIGHT(A1,3)/1000/60/60/24
You will need to format the cell with yyyy/mm/dd hh:mm:ss.000
In my test I changed 2006-06-10 05:45:15:349 to 2006/06/10 05:45:15.349
To get difference, I used =ROUND((F2-F1)*24*60*60,3)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"sp" wrote in message
...
I have two columns which contain timestamps in the format of yyyy-mm-dd
hh:mm:ss:msmsms (the last three digits are the milliseconds). I need to
find
the difference of the timestamps in ss:msmsms format.

I am trying to implement a VB function to do this as there is no
predefined
function available. Can anyone please assist?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.newusers
sp
 
Posts: n/a
Default how to find time difference between timestamps to a millisecon

Thank you!

"Bernard Liengme" wrote:

If you have date/time in exactly that format (ie 05 for fifth month not just
5) then this formula will convert your data to Excel's date/time format
=DATE(LEFT(A1,4),MID(A1,6,2),MID(A1,9,2))+TIME(MID (A1,12,2),MID(A1,15,2),MID(A1,18,2))+RIGHT(A1,3)/1000/60/60/24
You will need to format the cell with yyyy/mm/dd hh:mm:ss.000
In my test I changed 2006-06-10 05:45:15:349 to 2006/06/10 05:45:15.349
To get difference, I used =ROUND((F2-F1)*24*60*60,3)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"sp" wrote in message
...
I have two columns which contain timestamps in the format of yyyy-mm-dd
hh:mm:ss:msmsms (the last three digits are the milliseconds). I need to
find
the difference of the timestamps in ss:msmsms format.

I am trying to implement a VB function to do this as there is no
predefined
function available. Can anyone please assist?

Thanks!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time difference Stephanie Excel Worksheet Functions 5 March 21st 06 10:06 PM
Calculating Time difference based on a condition sonnethg Excel Discussion (Misc queries) 4 October 11th 05 09:25 PM
calculate negative or positve difference in time kpmoore Excel Discussion (Misc queries) 2 January 5th 05 01:35 AM
Calculating time difference Robyn Bellanger Excel Discussion (Misc queries) 2 December 23rd 04 02:29 AM
What is the formula for getting time difference e.g. ("4 hrs 15 m. Sandeep Manjrekar Charts and Charting in Excel 3 December 4th 04 05:18 AM


All times are GMT +1. The time now is 11:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"