+ Reply to Thread
Results 1 to 5 of 5

How to Calulate End Time for Working Hours?

  1. #1
    Registered User
    Join Date
    05-06-2008
    Posts
    55

    How to Calulate End Time for Working Hours?

    I have a gantt chart which is to show the projected completion times (date & time) for a given group of tasks with fixed durations (hours). The gantt chart is listed on one worksheet, and the working hours are listed on another worksheet.

    I need to calculate the end time (Date & Time) for each task, but the calculation must only count working hours. No time outside of the working hours, and no weekends should be used when calculating these figures.

    Can someone suggest a function which can handle this task? So far I have only found tips regarding hour to calculate the duration from a given start and end time, but that is kind of the opposite of what I’m going for.

    Thank you for all the help!
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    This type of calculation is trickier than it might appear......

    using WORKDAY function from Analysis ToolPak add-in you could use this formula in F2 copied down

    =WORKDAY(E2,(B2+MOD(E2,1)-Workdays!$B$2)/(Workdays!$B$3-Workdays!$B$2))+MOD(B2+MOD(E2,1)-Workdays!$B$2,Workdays!$B$3-Workdays!$B$2)+Workdays!$B$2

  3. #3
    Registered User
    Join Date
    05-06-2008
    Posts
    55
    DaddyLongLegs,

    That worked perfectly for what I needed. Thank you!

    Incase anyone anyone else can make use of this function, here is an explanation of same.

    =WORKDAY(StartTime,(Duration+MOD(StartTime,1)-$StartWorkday)/($EndWorkday-$StartWorkday))+MOD(Duration+MOD(StartTime,1)-$StartWorkday,$EndWorkday-$StartWorkday)+$StartWorkday

  4. #4
    Registered User
    Join Date
    04-11-2014
    Location
    holme
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: How to Calulate End Time for Working Hours?

    This worked great and i have looked at the sheet that you are using. It is a great template and something i have been trying to do for a while. I have used these ideas and altered my sheets to accomodate for my info rather than yours.

    I am having a problem with the gannt chart info though.

    I have used your sheet as a template for me and when i have entered my information into it the chart is not picking the correct information up. It is still picking up the start date as 21/07/2008, instead of the start date in the data field.

    Please can you help as i have tried a few things and cannot get it to work.

    Thank you in advance

    Matt

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to Calulate End Time for Working Hours?

    mattlarn,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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