Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Elapsed Time over 24 hours

I would like to know how to right a function to calculate time that spans
over 24 hours. Ex. StartTime 06:45 AM 06/17/06 EndTime 07:00 AM 06/18/06. I'm
new to this so take it slow thankyou
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Elapsed Time over 24 hours

One way:

A1: 06:45 AM 06/17/06
A2: 07:00 AM 06/18/06

A3: =A2-A1

A3 returns 24:15 when formatted with

Format/Cells/Number/Custom [h]:mm

the []'s keep hours from rolling over at 24.

In article ,
Fast Learner wrote:

I would like to know how to right a function to calculate time that spans
over 24 hours. Ex. StartTime 06:45 AM 06/17/06 EndTime 07:00 AM 06/18/06. I'm
new to this so take it slow thankyou

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Elapsed Time over 24 hours


or Format Cell as

dd "Days &" hh:mm "Mins"

to show as days and Mins

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=562269

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Elapsed Time over 24 hours

First, I'm not sure why you'd use hh:mm "Mins" since that will display
hours and minutes, not just minutes.


Second, what you're trying to do only works if the number of days are
<=31 AND you're using the 1900 Date system, since dd returns the day of
the month, not the number of days.

This APPEARS to work for a small number of days, since the 1900 date
system regards a value between 0 and 1 as day 0 (i.e., 0 January 1900 ==
31 December 1899).

However, you can see it fails when the number of days are 31 or if you
use the 1904 date system (0 = 1 January 1904, so dd for zero days
returns "01").



In article ,
VBA Noob
wrote:

or Format Cell as

dd "Days &" hh:mm "Mins"

to show as days and Mins

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Elapsed Time over 24 hours


Put this in your pipe

yy "Years " mm "Months" dd "Days &" mm "Min


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=562269



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Elapsed Time over 24 hours

Did you actually try your format?

Aside from the problem with not working in the 1904 date system, the
second mm will return months, not minutes.

Additionally,

A1: 7/16/2006 06:45
A2: 7/17/2006 07:00
A3: =A2-A1

returns

00 Years 01 Months 01 Days & 01 Min

with your formatting in the 1900 date system, which is clearly one month
too many.


In article ,
VBA Noob
wrote:

Put this in your pipe

yy "Years " mm "Months" dd "Days &" mm "Min

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Elapsed Time over 24 hours

Hey Everyone!
I didn't intend to start arguements or bad feelings
among posters. I'm just trying to learn how this can be down so the guys on
our department can track their trades on our network. Sorry if this is
causing a problem

"JE McGimpsey" wrote:

Did you actually try your format?

Aside from the problem with not working in the 1904 date system, the
second mm will return months, not minutes.

Additionally,

A1: 7/16/2006 06:45
A2: 7/17/2006 07:00
A3: =A2-A1

returns

00 Years 01 Months 01 Days & 01 Min

with your formatting in the 1900 date system, which is clearly one month
too many.


In article ,
VBA Noob
wrote:

Put this in your pipe

yy "Years " mm "Months" dd "Days &" mm "Min


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Elapsed Time over 24 hours

Thanks to everyone!!!! I just Tried JE McGimpsey's function and it seems to
work find.

"JE McGimpsey" wrote:

One way:

A1: 06:45 AM 06/17/06
A2: 07:00 AM 06/18/06

A3: =A2-A1

A3 returns 24:15 when formatted with

Format/Cells/Number/Custom [h]:mm

the []'s keep hours from rolling over at 24.

In article ,
Fast Learner wrote:

I would like to know how to right a function to calculate time that spans
over 24 hours. Ex. StartTime 06:45 AM 06/17/06 EndTime 07:00 AM 06/18/06. I'm
new to this so take it slow thankyou


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
Subtract time between certain days/work hours? lisa b. Excel Worksheet Functions 2 July 17th 06 09:26 PM
How can I change time format to decimal without losing hours? Bushman Excel Discussion (Misc queries) 2 July 16th 06 04:31 PM
calculate elapsed time between dates and times Jenna Excel Worksheet Functions 2 January 25th 06 04:39 PM
Time - Hours and Minutes Mark Zak Excel Discussion (Misc queries) 4 February 18th 05 01:51 AM
calculate difference in time to hours Chris Excel Worksheet Functions 5 January 18th 05 06:07 PM


All times are GMT +1. The time now is 10:44 AM.

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"