#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Time difference

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Time difference

Subtract them and multiply by 24 and format as general
or
Subtract them and format as [hh]:mm

=(a1-b1)*24
(formatted as general)

=a1-b1
(formatted as time)

Jithu wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Time difference

Maybe

=(B1-A1)*24

Where A1 is the earlier date/time. Format as general

Mike

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Time difference

If the dates are in Excel date format then just subtract one from the
other and format the resulting cell using a custom setting of
[hh]:mm:ss if you want the result to also be in date format. If you
want the result to be in hours, then do something like:

=(end_time - start_time)*24

and format the cell as number.

Hope this helps.

Pete

On Sep 17, 1:38 pm, Jithu wrote:
Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Time difference

OK...
how to do if both the dates happen to be same

eg eg 4/4/2007 0.00AM and 4/4/2007 1.00AM ...

i want the time difference as I hour

"Mike H" wrote:

Maybe

=(B1-A1)*24

Where A1 is the earlier date/time. Format as general

Mike

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Time difference

What did the suggested formula return?

Jithu wrote:

OK...
how to do if both the dates happen to be same

eg eg 4/4/2007 0.00AM and 4/4/2007 1.00AM ...

i want the time difference as I hour

"Mike H" wrote:

Maybe

=(B1-A1)*24

Where A1 is the earlier date/time. Format as general

Mike

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Time difference

To get Excel to recognise those as dates, try changing 0.00 to 0:00 (with a
colon), and leave a space between that and the AM. After that, follow the
suggestions of the other respondents. You'll also need to be sure that your
Windows Regional Settings recognise your format as DMY, not MDY.
--
David Biddulph

"Jithu" wrote in message
...
Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Time difference

Exactly the same way

01/01/2007 00:00 01/01/2007 01:00
=(B1-A1)*24

Would give an answer of 1.

Mike

"Jithu" wrote:

OK...
how to do if both the dates happen to be same

eg eg 4/4/2007 0.00AM and 4/4/2007 1.00AM ...

i want the time difference as I hour

"Mike H" wrote:

Maybe

=(B1-A1)*24

Where A1 is the earlier date/time. Format as general

Mike

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Time difference

Sorry Boss...it was my mistake...got it ........

thanks for you time and help

"Mike H" wrote:

Exactly the same way

01/01/2007 00:00 01/01/2007 01:00
=(B1-A1)*24

Would give an answer of 1.

Mike

"Jithu" wrote:

OK...
how to do if both the dates happen to be same

eg eg 4/4/2007 0.00AM and 4/4/2007 1.00AM ...

i want the time difference as I hour

"Mike H" wrote:

Maybe

=(B1-A1)*24

Where A1 is the earlier date/time. Format as general

Mike

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Time difference

Thanks Boss....got it

"Dave Peterson" wrote:

Subtract them and multiply by 24 and format as general
or
Subtract them and format as [hh]:mm

=(a1-b1)*24
(formatted as general)

=a1-b1
(formatted as time)

Jithu wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.


--

Dave Peterson



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Time difference

if the start date is in E2 and the end date in F2 then use the following
formula. It displays the difference in hours and mins.

=INT((F2-E2)*24)&" hrs: "&INT((((F2-E2)*24)-(INT((F2-E2)*24)))*60)&" mins"

best regards,

Jerome

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Time difference

If you use these values

E2: 12/19/2007 4:30:00 PM

F2: 12/21/2007 4:17:00 AM

your formula returns 35 hrs: 46 mins which is 1 minute off. This much
smaller formula seems to return the correct values...

=TEXT(F2-E2,"[h] \h\r\s: m \m\i\n\s")

Rick


"Jerome" wrote in message
...
if the start date is in E2 and the end date in F2 then use the following
formula. It displays the difference in hours and mins.

=INT((F2-E2)*24)&" hrs: "&INT((((F2-E2)*24)-(INT((F2-E2)*24)))*60)&" mins"

best regards,

Jerome

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.


  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Time difference

Hi Rick,

Thanks for the valuable feedback its much appreciated ... I love this forum
for all the valuable expertise it gives ... have a gr8 day

Jerome

"Rick Rothstein (MVP - VB)" wrote:

If you use these values

E2: 12/19/2007 4:30:00 PM

F2: 12/21/2007 4:17:00 AM

your formula returns 35 hrs: 46 mins which is 1 minute off. This much
smaller formula seems to return the correct values...

=TEXT(F2-E2,"[h] \h\r\s: m \m\i\n\s")

Rick


"Jerome" wrote in message
...
if the start date is in E2 and the end date in F2 then use the following
formula. It displays the difference in hours and mins.

=INT((F2-E2)*24)&" hrs: "&INT((((F2-E2)*24)-(INT((F2-E2)*24)))*60)&" mins"

best regards,

Jerome

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.



  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Time difference

You are welcome. By the way, I notice that your posting is a response to
someone else posting, but it shows up in my newsreader as starting a new
message thread. I looked for the original message you responded to, but I
couldn't find it. Apparently, that message was (very?) old and is not in my
downloaded database of messages for this newsgroup. So, I'm guessing the
original poster is not going to see our messages.

Rick



"Jerome" wrote in message
...
Hi Rick,

Thanks for the valuable feedback its much appreciated ... I love this
forum
for all the valuable expertise it gives ... have a gr8 day

Jerome

"Rick Rothstein (MVP - VB)" wrote:

If you use these values

E2: 12/19/2007 4:30:00 PM

F2: 12/21/2007 4:17:00 AM

your formula returns 35 hrs: 46 mins which is 1 minute off. This much
smaller formula seems to return the correct values...

=TEXT(F2-E2,"[h] \h\r\s: m \m\i\n\s")

Rick


"Jerome" wrote in message
...
if the start date is in E2 and the end date in F2 then use the
following
formula. It displays the difference in hours and mins.

=INT((F2-E2)*24)&" hrs: "&INT((((F2-E2)*24)-(INT((F2-E2)*24)))*60)&"
mins"

best regards,

Jerome

"Jithu" wrote:

Hi,

Is is possible to find out the difference between two dates in Hours.

eg 4/4/2007 0.00AM and 5/4/2007 0.00AM

Difference is 24 hrs

Please sort this out...thanks in advance for the help.




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 calculations, daylight savings time, Excel Tim Excel Discussion (Misc queries) 1 December 28th 06 04:18 PM
Time difference RobertLees Excel Discussion (Misc queries) 0 January 4th 06 11:25 PM
Negative time should be allowed in Excel, eg time difference Bengt-Inge Larsson Excel Discussion (Misc queries) 2 October 13th 05 12:59 PM
Time zone Time difference mac_see Excel Worksheet Functions 0 May 3rd 05 07:57 PM
Time / Formula to look at time difference carl Excel Worksheet Functions 5 November 8th 04 06:59 PM


All times are GMT +1. The time now is 03:54 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"