+ Reply to Thread
Results 1 to 11 of 11

Calculate start date & time of task (working hours)

  1. #1
    Registered User
    Join Date
    06-11-2010
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    17

    Calculate start date & time of task (working hours)

    Hello,

    I need to calculate required start date + time of a task based on duration of the task (expressed in working hours) and required finish date + time. I found formula to calculate number of working hours between 2 dates (see formula below). However I need similar formula to calculate start date + time starting. Assume working hours from 8:00 to 17:00, duration is 13 hours and END date + time = 16/06/2010 9:00, then formula should return 14/06/2010 13:00 as START date. Note that formulate should also exclude weekends.

    Please Login or Register  to view this content.
    A2 = start time/date
    B2 = end time/date
    J2 = MF start time, e.g. 08:00
    J3 = MF end time e.g. 17:00

    Is there anyone who can help?

    Regards,

    Kaatje

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Calculate start date & time of task (working hours)

    Hi Kaatje,

    should week ends and holidays be excluded?

  3. #3
    Registered User
    Join Date
    06-11-2010
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Calculate start date & time of task (working hours)

    Hi,

    Yes weekends and holidays should be excluded.

    Kaatje

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate start date & time of task (working hours)

    You coudl perhaps try something along the lines of:

    =WORKDAY($B2;-FLOOR($A2/MOD($G$1-$F$1;1);1))+$G$1-MOD($A2-(MOD($B2;1)-$G$1);$G$1-$F$1)

    where

    A2 holds duration (13:00)
    B2 holds start date time - assumed to be within a working window (eg 16/06/2010 09:00)

    F1 holds working start time (08:00)
    G1 holds working end time (17:00)

    You can add holiday range to WORKDAY as required

    I have no doubt daddylonglegs can shorten / improve.

    Incidentally based on your sample I believe end time should be 14:00 rather than 13:00 (1 hour day 1, 9 hours day 2 and 3 hours day 3)

  5. #5
    Registered User
    Join Date
    06-11-2010
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Calculate start date & time of task (working hours)

    Hi,

    Indeed, your remark is correct, in my example start time should be 14:00 --> So formula should return 14/06/2010 14:00 however, when I try this it returns 29/04/2010 11:00.

    What could be the problem?

    Kaatje

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate start date & time of task (working hours)

    In retrospect it doesn't work for all scenarios ... in the words of Arnie - I'll be back.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate start date & time of task (working hours)

    I think this works

    Please Login or Register  to view this content.
    A2 - duration - eg 13:00
    B2 - end datetime - eg 16/06 09:00
    F1 - work start time - eg 08:00
    G1 - work end time - eg 17:00
    However, I have no doubt (whatsoever) that the above can be condensed significantly - hopefully daddylonglegs will put me out of my misery later on today.

  8. #8
    Registered User
    Join Date
    06-11-2010
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Calculate start date & time of task (working hours)

    For now this helps me a lot, thanks!

  9. #9
    Registered User
    Join Date
    03-30-2016
    Location
    Edinburgh
    MS-Off Ver
    Mac 11
    Posts
    6

    Re: Calculate start date & time of task (working hours)

    Hi,

    How would you change this formula so it calculated the end date and time based on a start date/time and number of hours?

    Thanks
    Duncan

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Calculate start date & time of task (working hours)

    ded1 welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Registered User
    Join Date
    03-30-2016
    Location
    Edinburgh
    MS-Off Ver
    Mac 11
    Posts
    6

    Re: Calculate start date & time of task (working hours)

    Thanks FDibbins, I have done so.
    Duncan

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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