Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Time elapsed calculation


I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an actual
time, so it can then be compared to the system time using the Now function to
calculate the time elasped. The time elapsed would need to show in number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


--
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 834
Default Time elapsed calculation

Try

=(MOD(NOW(),1)-TIME(MID(A20,10,1),MID(A20,11,2),0))*24

--

HTH

Bob

"MTate" wrote in message
...

I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an
actual
time, so it can then be compared to the system time using the Now function
to
calculate the time elasped. The time elapsed would need to show in number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


--
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time elapsed calculation

=(NOW()-TEXT(A2,"0000\-00\-00 00\:00\:00"))*24 and format the result as
General or Number.
--
David Biddulph


"MTate" wrote in message
...

I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an
actual
time, so it can then be compared to the system time using the Now function
to
calculate the time elasped. The time elapsed would need to show in number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


--
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Time elapsed calculation

On Fri, 9 Apr 2010 20:15:36 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

=(NOW()-TEXT(A2,"0000\-00\-00 00\:00\:00"))*24 and format the result as
General or Number.
--
David Biddulph


Note that, although that will work with US based systems, if the Windows
Regional format is set to some of the non-US formats, this will not translate
correctly.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time elapsed calculation

I'm surprised at that, Ron. I'm in the UK, not the US, and I thought that
yyyy-mm-dd was accepted universally. I know that there are problems with
dd-mm-yyyy and mm-dd-yyyy, but I hadn't come across problems with
yyyy-mm-dd.
--
David Biddulph


"Ron Rosenfeld" wrote in message
...
On Fri, 9 Apr 2010 20:15:36 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

=(NOW()-TEXT(A2,"0000\-00\-00 00\:00\:00"))*24 and format the result as
General or Number.
--
David Biddulph


Note that, although that will work with US based systems, if the Windows
Regional format is set to some of the non-US formats, this will not
translate
correctly.
--ron





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 834
Default Time elapsed calculation

yyyy-mm-dd should be okay, it is the ISO standard format. It is what I use
in my SP solutions precisely beciuse it seems the one format not to cause
problems.

--

HTH

Bob

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
I'm surprised at that, Ron. I'm in the UK, not the US, and I thought that
yyyy-mm-dd was accepted universally. I know that there are problems with
dd-mm-yyyy and mm-dd-yyyy, but I hadn't come across problems with
yyyy-mm-dd.
--
David Biddulph


"Ron Rosenfeld" wrote in message
...
On Fri, 9 Apr 2010 20:15:36 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

=(NOW()-TEXT(A2,"0000\-00\-00 00\:00\:00"))*24 and format the result as
General or Number.
--
David Biddulph


Note that, although that will work with US based systems, if the Windows
Regional format is set to some of the non-US formats, this will not
translate
correctly.
--ron





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Time elapsed calculation

On Sat, 10 Apr 2010 11:12:25 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

I'm surprised at that, Ron. I'm in the UK, not the US, and I thought that
yyyy-mm-dd was accepted universally. I know that there are problems with
dd-mm-yyyy and mm-dd-yyyy, but I hadn't come across problems with
yyyy-mm-dd.
--
David Biddulph


David,

I'm based in the US and the formula works OK with US settings.

However, if I go to the Windows Control Panel, and change my format, on the
Format tab, to French(France), your formula changes, appropriately, to:

=(NOW()-TEXT(A2;"0000\-00\-00 00\:00\:00"))*24

(Windows 7-64bit; Excel 2007)

but the result is #VALUE!

If I then change to English(UK), the formula calculates correctly.

--ron
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Time elapsed calculation

=(MOD(NOW(),1)-TEXT(RIGHT(A1,6),"00\:00\:00"))*24



"MTate" wrote:


I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an actual
time, so it can then be compared to the system time using the Now function to
calculate the time elasped. The time elapsed would need to show in number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


--
Thanks

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time elapsed calculation

But beware that you couldn't use that to get an elapsed time spanning
midnight.
--
David Biddulph


"Teethless mama" wrote in message
...
=(MOD(NOW(),1)-TEXT(RIGHT(A1,6),"00\:00\:00"))*24



"MTate" wrote:


I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an
actual
time, so it can then be compared to the system time using the Now
function to
calculate the time elasped. The time elapsed would need to show in
number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


--
Thanks



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Time elapsed calculation

On Fri, 9 Apr 2010 10:51:02 -0700, MTate
wrote:


I have a text string in a cell that comes from an AS400. I need for this
string to convert to a time value.

Example text: 20100409073000
In the AS400 this represents the date of 4/9/2010 and 7:30 AM. So
YYYYMMDDHHMMSS is the format.

What I need to do is extract the 073000 part off and convert it to an actual
time, so it can then be compared to the system time using the Now function to
calculate the time elasped. The time elapsed would need to show in number
format, so 4 hours and 15 minutes would be 4.25

Any help would be appreciated.


Because of the possibility of the difference extending over midnight, I would
suggest you convert the entire string into a date/time string:

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

To compare it with the system time:

=(NOW()-(DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID (A1,9,2),MID(A1,11,2),RIGHT(A1,2))))*24

and format the result as Number with two decimals.
--ron


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
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
Elapsed time LtFass Excel Discussion (Misc queries) 3 November 10th 07 11:45 PM
Need Elapsed Time Help Jwy Excel Worksheet Functions 2 September 29th 05 03:54 AM
elapsed time Sweetpea60 Excel Worksheet Functions 6 March 2nd 05 04:41 PM
elapsed time calculation rwf Excel Discussion (Misc queries) 1 January 21st 05 04:51 AM


All times are GMT +1. The time now is 05:25 PM.

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

About Us

"It's about Microsoft Excel"