+ Reply to Thread
Results 1 to 8 of 8

Working days and hours only

Hybrid View

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Working days and hours only

    Hey guys,

    I need your help with the following

    If I have start date and time in A1 and end date and time in B1, and i want to count the minutes deference between them how can i do it. Taking in consideration that only working days & hours are to be calculated which mean you'll have to exclude the weekends and non working hours

    Weekend = Friday and Saturday
    Working hours = From 8:00 AM to 17:00 PM
    A1= 07/09/2013 9:30:00 AM
    B1= 13/09/2013 4:00:00 PM

    ** I'm using Excel 2007

    Thanks in advance

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Working days and hours only

    Hi and welcome to the forum.

    Your solution should be here.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    04-03-2012
    Location
    Riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Working days and hours only

    Thank you very much Fotis1991 for the prompt reply

    So here where I stand. I took this formula and changed the work day start and end hours from

    =(18/24-MOD(A1,1)+MOD(A2,1)-9/24)*24 + (NETWORKDAYS(A1,A2)-2)*9

    to

    =(17/24-MOD(A1,1)+MOD(A2,1)-8/24)*24 + (NETWORKDAYS(A1,A2)-2)*9

    It's not giving me what i want.

    * I know that NETWORKDAYS is excluding Saturdays and Sundays so I think I have to add something to change that
    * The calculation should exclude anything before 8 Am and exclude anything after 5 PM

    Note: A1= 07/09/2013 9:30:00 AM
    A2= 13/09/2013 4:00:00 PM
    The result should be 45 hours
    Last edited by malbarki; 09-19-2013 at 02:47 AM.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Working days and hours only

    Did you uploaded the example sheet from the link that i provided?

    It's clear and use instunctions for how to do this. I filled with yellow color your example!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-03-2012
    Location
    Riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Working days and hours only

    I tried the provided sheet but I think the formula needs to be amended to fulfill my criteria because I need the formula to exclude the following from the final result:

    1) All Fridays and Saturdays hours
    2) Non-working hours from Sundays, Mondays, Tuesdays, Wednesdays and Thursdays

    Expected Result from the given dates

    Start Date and Time 07/09/2013 9:30:00 AM = Excluded
    08/09/2013 = 9 Hours
    09/09/2013 = 9 Hours
    10/09/2013 = 9 Hours
    11/09/2013 = 9 Hours
    12/09/2013 = 9 Hours
    End Date and Time 13/09/2013 4:00:00 PM = Excluded

    Final Result = 45 Hours
    ----------------------------------------------------------
    Another Example

    Start Date and Time 18/09/2013 7:00:00 AM = 9 Hours << as anything before 8AM should be excluded
    19/09/2013 = 9 Hours
    20/09/2013 = Excluded
    21/09/2013 = Excluded
    End Date and Time 22/09/2013 7:00:00 PM = 9 Hours << as anything after 5PM should be excluded

    Final Result = 27 Hours

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Working days and hours only

    So apologize but i haven't understand that for you weekend is Friday & Saturday.

    Some time ago i had seen something like that but i can not remember when and where. The only sure is that was a ddl solution.

    If you want make a search to his replies...

  7. #7
    Registered User
    Join Date
    04-03-2012
    Location
    Riyadh
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Working days and hours only

    Thank you very much Fotis1991 for trying

    I dropped a MSG in ddl inbox to visit my thread and I'm searching through his posts

    Wish me luck

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Working days and hours only

    Quote Originally Posted by malbarki View Post
    Thank you very much Fotis1991 for trying

    I dropped a MSG in ddl inbox to visit my thread and I'm searching through his posts

    Wish me luck
    So good luck!

    Which i am sure that you'll have if ddl see your thread!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-13-2013, 05:19 AM
  2. Calculating working days AND hours
    By Pearl_Jam in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-07-2013, 02:28 PM
  3. Replies: 4
    Last Post: 11-30-2011, 03:25 PM
  4. Working out hours between days
    By Loisw in forum Excel General
    Replies: 1
    Last Post: 08-04-2009, 03:06 AM
  5. Network days/working Hours
    By Kolacube in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-22-2008, 09:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1