Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default Calculate time differential - Mon - Fri workday basis

I'd like to calculate the time worked on a project using the Start and End
times, however, the resultant number has to take into consideration only
those hours worked during a regular day, and also has to account for no work
being done on the weekends. For example, if a standard workday/workweek is
8a - 5p Monday thru Friday and the Start time is Friday at 3p and End time is
Monday at 11a, the actual work time would be 2 hours on Friday (3p - 5p) and
3 hours on Monday (8a - 11a), for a total of 5 hours. Similarly, Start time
of Tuesday at 4p and End time of Thursday at 4p would equate to 18 hours, 1
hour on Tuesday, 9 on Wednesday, and 8 on Thursday. Can someone help me
calculate this in excel? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Calculate time differential - Mon - Fri workday basis

Don,

With the start date and time in A2, and the end date and time in B2, this formula should work - the
values must the date/times and not just strings that look like dates and times:

=IF(B2A2,MAX(0,(NETWORKDAYS(A2,B2)-2))*9 +
IF((INT(B2)-INT(A2))0,"17:00"-(A2-INT(A2))+(B2-INT(B2)-"8:00"),(B2-A2))*24,"Bad times")

If the NETWORKDAYS is not available (returns the #NAME? error) install and load the Analysis ToolPak
add-in. Also, you can add a list of holidays to the NETWORKDAYS function as a third argument to
account for those days in the formula.


HTH,
Bernie
MS Excel MVP


"Don" wrote in message
...
I'd like to calculate the time worked on a project using the Start and End
times, however, the resultant number has to take into consideration only
those hours worked during a regular day, and also has to account for no work
being done on the weekends. For example, if a standard workday/workweek is
8a - 5p Monday thru Friday and the Start time is Friday at 3p and End time is
Monday at 11a, the actual work time would be 2 hours on Friday (3p - 5p) and
3 hours on Monday (8a - 11a), for a total of 5 hours. Similarly, Start time
of Tuesday at 4p and End time of Thursday at 4p would equate to 18 hours, 1
hour on Tuesday, 9 on Wednesday, and 8 on Thursday. Can someone help me
calculate this in excel? Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default Calculate time differential - Mon - Fri workday basis

Thanks Bernie!!! Exactly what I was looking for!!

"Bernie Deitrick" wrote:

Don,

With the start date and time in A2, and the end date and time in B2, this formula should work - the
values must the date/times and not just strings that look like dates and times:

=IF(B2A2,MAX(0,(NETWORKDAYS(A2,B2)-2))*9 +
IF((INT(B2)-INT(A2))0,"17:00"-(A2-INT(A2))+(B2-INT(B2)-"8:00"),(B2-A2))*24,"Bad times")

If the NETWORKDAYS is not available (returns the #NAME? error) install and load the Analysis ToolPak
add-in. Also, you can add a list of holidays to the NETWORKDAYS function as a third argument to
account for those days in the formula.


HTH,
Bernie
MS Excel MVP


"Don" wrote in message
...
I'd like to calculate the time worked on a project using the Start and End
times, however, the resultant number has to take into consideration only
those hours worked during a regular day, and also has to account for no work
being done on the weekends. For example, if a standard workday/workweek is
8a - 5p Monday thru Friday and the Start time is Friday at 3p and End time is
Monday at 11a, the actual work time would be 2 hours on Friday (3p - 5p) and
3 hours on Monday (8a - 11a), for a total of 5 hours. Similarly, Start time
of Tuesday at 4p and End time of Thursday at 4p would equate to 18 hours, 1
hour on Tuesday, 9 on Wednesday, and 8 on Thursday. Can someone help me
calculate this in excel? Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Calculate time differential - Mon - Fri workday basis


Thanks Bernie!!! Exactly what I was looking for!!



Glad to hear it -- and thanks for letting me know. :-)

Bernie
MS Excel MVP


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 profits on stock sales on FIFO basis Vivek[_2_] New Users to Excel 8 May 5th 23 07:42 PM
How do you calculate workdays if Saturday is a workday? Tracy Parish Excel Worksheet Functions 3 April 18th 08 12:18 PM
how do I calculate growth on a long term award on a linear basis WaqB Excel Worksheet Functions 1 November 23rd 06 10:58 PM
Time Differential Error??? The Merg Excel Worksheet Functions 4 September 27th 06 10:58 PM
How to calculate next WORKDAY? The Tan Man Excel Programming 4 September 1st 05 07:28 PM


All times are GMT +1. The time now is 07:38 AM.

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"