Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-2008, 03:52 AM
west4961@yahoo.com
 
Posts: n/a
Between date and time

How do you calculate two dates with hours, minutes and seconds included...
Also, the data is all numbers like 20080514235050 to 20080515000505
(yyyymmddhhmmss)... Thanks..
Reply With Quote
  #2 (permalink)  
Old 05-18-2008, 08:26 AM
Nick Hodge
 
Posts: n/a
Re: Between date and time

You will pretty much need to parse the date out and then do your
calculation. If your date is in E4

=DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(E4,2))

Will get your number into a date, then use it again on the other date an put
the two together for the calculation so if one date was in E4 and the other
in F4 and you wanted the difference

=DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(E4,2))-=DATE(LEFT(F4,4),MID(F4,5,2),MID(F4,7,2))+TIME(MID (F4,9,2),MID(F4,11,2),RIGHT(F4,2))

This could be shortened up using a UDF

Bear in mind your formatting of the result will determine how it is
displayed. read up here for more info

www.cpearson.com/excel/datetime.htm

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
web: www.excelusergroup.org
web: www.nickhodge.co.uk





<west4961@yahoo.com> wrote in message
news:etednZvYkYSbB7LVnZ2dnUVZ_qqgnZ2d@comcast.com. ..
> How do you calculate two dates with hours, minutes and seconds included...
> Also, the data is all numbers like 20080514235050 to 20080515000505
> (yyyymmddhhmmss)... Thanks..


Reply With Quote
  #3 (permalink)  
Old 05-18-2008, 12:24 PM
=?Utf-8?B?ZGFkZHlsb25nbGVncw==?=
 
Posts: n/a
Re: Between date and time

You can convert to a TRUE date/time with this formula

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

so, assuming data in A1 and B1 you can get the difference with this formula

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

format result cell as [h]:mm:ss

"Nick Hodge" wrote:

> You will pretty much need to parse the date out and then do your
> calculation. If your date is in E4
>
> =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(E4,2))
>
> Will get your number into a date, then use it again on the other date an put
> the two together for the calculation so if one date was in E4 and the other
> in F4 and you wanted the difference
>
> =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(E4,2))-=DATE(LEFT(F4,4),MID(F4,5,2),MID(F4,7,2))+TIME(MID (F4,9,2),MID(F4,11,2),RIGHT(F4,2))
>
> This could be shortened up using a UDF
>
> Bear in mind your formatting of the result will determine how it is
> displayed. read up here for more info
>
> www.cpearson.com/excel/datetime.htm
>
> --
> HTH
> Nick Hodge
> Microsoft MVP - Excel
> Southampton, England
> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
> web: www.excelusergroup.org
> web: www.nickhodge.co.uk
>
>
>
>
>
> <west4961@yahoo.com> wrote in message
> news:etednZvYkYSbB7LVnZ2dnUVZ_qqgnZ2d@comcast.com. ..
> > How do you calculate two dates with hours, minutes and seconds included...
> > Also, the data is all numbers like 20080514235050 to 20080515000505
> > (yyyymmddhhmmss)... Thanks..

>
>

Reply With Quote
  #4 (permalink)  
Old 05-20-2008, 12:35 AM
west4961@yahoo.com
 
Posts: n/a
Re: Between date and time

How could I read the result in seconds only? Thanks your help...

In article <19914654-E4F1-489D-A170-C01A79CA7F8D@microsoft.com>,
=?Utf-8?B?ZGFkZHlsb25nbGVncw==?= <d.addylonglegs@virgin.net> wrote:
>You can convert to a TRUE date/time with this formula
>
>=TEXT(A1,"0000-00-00 00\:00\:00")+0
>
>so, assuming data in A1 and B1 you can get the difference with this formula
>
>=TEXT(B1,"0000-00-00 00\:00\:00")-TEXT(A1,"0000-00-00 00\:00\:00")
>
>format result cell as [h]:mm:ss
>
>"Nick Hodge" wrote:
>
>> You will pretty much need to parse the date out and then do your
>> calculation. If your date is in E4
>>
>>

> =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(
>E4,2))
>>
>> Will get your number into a date, then use it again on the other date an put
>> the two together for the calculation so if one date was in E4 and the other
>> in F4 and you wanted the difference
>>
>>

> =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(
>E4,2))-=DATE(LEFT(F4,4),MID(F4,5,2),MID(F4,7,2))+TIME(MID (F4,9,2),MID(F4,11,2),
>RIGHT(F4,2))
>>
>> This could be shortened up using a UDF
>>
>> Bear in mind your formatting of the result will determine how it is
>> displayed. read up here for more info
>>
>> www.cpearson.com/excel/datetime.htm
>>
>> --
>> HTH
>> Nick Hodge
>> Microsoft MVP - Excel
>> Southampton, England
>> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
>> web: www.excelusergroup.org
>> web: www.nickhodge.co.uk
>>
>>
>>
>>
>>
>> <west4961@yahoo.com> wrote in message
>> news:etednZvYkYSbB7LVnZ2dnUVZ_qqgnZ2d@comcast.com. ..
>> > How do you calculate two dates with hours, minutes and seconds included...
>> > Also, the data is all numbers like 20080514235050 to 20080515000505
>> > (yyyymmddhhmmss)... Thanks..

>>
>>

Reply With Quote
  #5 (permalink)  
Old 05-20-2008, 12:44 AM
Dave Peterson
 
Posts: n/a
Re: Between date and time

You could use a custom number format of: [ss]
And the value will still be a date/time.

Or you could modify the formula to return the number of seconds:
=(TEXT(B1,"0000-00-00 00\:00\:00")-TEXT(A1,"0000-00-00 00\:00\:00"))*24*60*60
(format as General)

west4961@yahoo.com wrote:
>
> How could I read the result in seconds only? Thanks your help...
>
> In article <19914654-E4F1-489D-A170-C01A79CA7F8D@microsoft.com>,
> =?Utf-8?B?ZGFkZHlsb25nbGVncw==?= <d.addylonglegs@virgin.net> wrote:
> >You can convert to a TRUE date/time with this formula
> >
> >=TEXT(A1,"0000-00-00 00\:00\:00")+0
> >
> >so, assuming data in A1 and B1 you can get the difference with this formula
> >
> >=TEXT(B1,"0000-00-00 00\:00\:00")-TEXT(A1,"0000-00-00 00\:00\:00")
> >
> >format result cell as [h]:mm:ss
> >
> >"Nick Hodge" wrote:
> >
> >> You will pretty much need to parse the date out and then do your
> >> calculation. If your date is in E4
> >>
> >>

> > =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(
> >E4,2))
> >>
> >> Will get your number into a date, then use it again on the other date an put
> >> the two together for the calculation so if one date was in E4 and the other
> >> in F4 and you wanted the difference
> >>
> >>

> > =DATE(LEFT(E4,4),MID(E4,5,2),MID(E4,7,2))+TIME(MID (E4,9,2),MID(E4,11,2),RIGHT(
> >E4,2))-=DATE(LEFT(F4,4),MID(F4,5,2),MID(F4,7,2))+TIME(MID (F4,9,2),MID(F4,11,2),
> >RIGHT(F4,2))
> >>
> >> This could be shortened up using a UDF
> >>
> >> Bear in mind your formatting of the result will determine how it is
> >> displayed. read up here for more info
> >>
> >> www.cpearson.com/excel/datetime.htm
> >>
> >> --
> >> HTH
> >> Nick Hodge
> >> Microsoft MVP - Excel
> >> Southampton, England
> >> nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
> >> web: www.excelusergroup.org
> >> web: www.nickhodge.co.uk
> >>
> >>
> >>
> >>
> >>
> >> <west4961@yahoo.com> wrote in message
> >> news:etednZvYkYSbB7LVnZ2dnUVZ_qqgnZ2d@comcast.com. ..
> >> > How do you calculate two dates with hours, minutes and seconds included...
> >> > Also, the data is all numbers like 20080514235050 to 20080515000505
> >> > (yyyymmddhhmmss)... Thanks..
> >>
> >>


--

Dave Peterson
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



All times are GMT. The time now is 04:54 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Remortgaging | Share Prices | Internet Advertising | Personal Loan | Internet Advertising



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114