#1   Report Post  
Posted to microsoft.public.excel.misc
RA RA is offline
external usenet poster
 
Posts: 53
Default Hours difference

Need to calculate difference in terms of hours....weekend issue.
1st date and time - 1/29/10 (friday) 1:00am
2nd date and time - 2/1/10 (monday) 1:00am
By calculating manually, the result that i would need to show is 24 hrs
(based on my shop floor operations). Anything more than 24hrs is an issue at
my operations.
How would i do this in excel?
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Hours difference

Hmmm...., if the 01:00 can be ignored you may try this:
In A1 - Start Date
In A2 - End Date
In A3 - The hereunder Array-Formula:
{=24*(SUM(N(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))<7))-SUM(N(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=1))-1))
The formula should be entered with CTRL+SHIFT+ENTER rather than with simply
ENTER.
The curly brackets {} are not to be typed manually, those are entered by the
Excel, when the formula is entered as an Array formula.
Micky


"Ra" wrote:

Need to calculate difference in terms of hours....weekend issue.
1st date and time - 1/29/10 (friday) 1:00am
2nd date and time - 2/1/10 (monday) 1:00am
By calculating manually, the result that i would need to show is 24 hrs
(based on my shop floor operations). Anything more than 24hrs is an issue at
my operations.
How would i do this in excel?
Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Hours difference

Try this:
=(b1-a1)*24-(weekday(b1)<weekday(a1))*48

Regards
Fred

"Ra" wrote in message
...
Need to calculate difference in terms of hours....weekend issue.
1st date and time - 1/29/10 (friday) 1:00am
2nd date and time - 2/1/10 (monday) 1:00am
By calculating manually, the result that i would need to show is 24 hrs
(based on my shop floor operations). Anything more than 24hrs is an issue
at
my operations.
How would i do this in excel?
Thank you.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Hours difference

If start time in A1, end time in A2, this will work provided neither start or
stop occurs on a weekend:

=A2-A1-(INT(A2)-INT(A1)-(NETWORKDAYS(A1,A2)-1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Ra" wrote:

Need to calculate difference in terms of hours....weekend issue.
1st date and time - 1/29/10 (friday) 1:00am
2nd date and time - 2/1/10 (monday) 1:00am
By calculating manually, the result that i would need to show is 24 hrs
(based on my shop floor operations). Anything more than 24hrs is an issue at
my operations.
How would i do this in excel?
Thank you.

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 from 24 hours The Incredible Excel Discussion (Misc queries) 3 October 17th 08 01:20 PM
Calculating the difference between hours Oliver Excel Worksheet Functions 1 June 1st 08 07:48 PM
How Do I Get The Difference In Hours and Mins medicom06 Excel Worksheet Functions 4 August 12th 05 03:06 AM
How to get difference in hours Akhilesh Dalia Excel Worksheet Functions 6 April 23rd 05 06:41 AM
Difference in Hours Karan Excel Discussion (Misc queries) 4 April 21st 05 11:07 AM


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