Hi,
I have 2 dates format like 200903021124 and 200903030254
How do I use excel or excel VBA to calculate what is the time that elapses between this 2 date format?
Rgds,
Samuel
Hi,
I have 2 dates format like 200903021124 and 200903030254
How do I use excel or excel VBA to calculate what is the time that elapses between this 2 date format?
Rgds,
Samuel
Last edited by boisonbeauty; 03-02-2009 at 08:45 AM.
Samuel, obviously it would help if you identified what the values reflected ... ie is it YYYYMMDDhhmm or YYYYDDMMhhmm ?
Assuming 200903021124 = 2nd March 2009 11:24 ... and you're looking to subtract A1 from B1 (given B1 would be 3rd March):
C1:
=TEXT(B1,"0000-00-00 00\:00")-TEXT(A1,"0000-00-00 00\:00")
C1 would be a time value so you would need to use a Time Format to display correctly, eg a Custom Format of:
[hh]:mm
Would display 15:30
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Thank you very much, DonkeyOte.
It works perfectly. However, I just made slight modification to it to be
C1:
=TEXT(B1,"0000-00-00 00\:00\:00")-TEXT(A1,"0000-00-00 00\:00\:00")
as my A1 and B1 is in the format of yyyymmddhhmmss (with second interval behind)
Rgds,
Samuel
Glad to hear it - please mark as SOLVED (see How To section for more info.)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks