+ Reply to Thread
Results 1 to 6 of 6

Weekday/Workday/Holidays Formula to calculate finish date

  1. #1
    Registered User
    Join Date
    03-10-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Weekday/Workday/Holidays Formula to calculate finish date

    Hi everyone,

    First post here so thank you in advance. I've used this forum so much in the past to find answers to questions but now I have one of my own that I have no idea how to overcome.

    I have a sheet that is for planning jobs (attached is a ripped out very basic sample). Basically the start date in the top job begins with today's date, it has a certain number of hours allocated to it, which in turn is converted to days and then calculates a projected finish date. This then auto calculates the remaining jobs giving estimated start and finish dates as a rough plan.

    This works fine using the below weekday formula. It correctly adds the number of days onto the date and even manages to know when to push it to the next day so you can't physically do more work than allows in an 8 hour day.

    =IFERROR(IF(WEEKDAY(D2+C2,2)>5,D2+C2+(8-WEEKDAY(D2+C2,2)),D2+C2),"")

    The only problem with this formula is that I have no way of including holidays/bank holidays etc. If I replace the non bracketed parts with WORKDAY(D2,C2,Holidays) then it includes holidays however it starts telling me I can do multiple jobs in one day that total more than 1 8 hour day so physically impossible!

    I have attached a sample workbook.

    If someone... anyone... can get the weekday formula working with holidays and pushing dates over to following days if cumulative value = more than an 8 hour day, I would be ever so grateful!

    Cheers

    Dan
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Weekday/Workday/Holidays Formula to calculate finish date

    I think this might do it for you. I cooked this up about a decade ago. I also have NetWorkHours, too.

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    03-10-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Weekday/Workday/Holidays Formula to calculate finish date

    Quote Originally Posted by dflak View Post
    I think this might do it for you. I cooked this up about a decade ago. I also have NetWorkHours, too.

    Please Login or Register  to view this content.
    Thank you for this! How do i go about using it so i can give it a go? Functions are pretty new to me...

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Weekday/Workday/Holidays Formula to calculate finish date

    First, you'll have to put it into a workbook that supports macros (*.XLSM or *.XLSB). The Click Alt-F11 to open the VB editor. Then select Insert > Module and copy / paste this code into it.

    Then you can use it like any other function: =WorkHours(Start Date / Time, Number of hours for the job, Shift Start Time, Shift End Time, Holidays)

    Where Holidays is a list dates for holidays. The best way to establish this list is to list them in a column, highlight the list and then in the Name Box (Upper left on ribbon - it should contain the cell reference for the first cell) and type in the name of the range. Call it Holidays!

  5. #5
    Registered User
    Join Date
    03-10-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Weekday/Workday/Holidays Formula to calculate finish date

    Ok... so I've managed to get it up and running but it just wont return the values I'm expecting.

    Screenshot 2022-01-07 213159.png

    As you can see in the example:

    Job 1 & 2 are correct
    I'd then expect Job 3 to start on the 7th but not be finished until the 17th as there has already been 6 out 8 hours work done that day and because job 3 is a 6 hour job, they can get 2 hours done on the 7th but cant be finished until the 17th due to the holiday days
    The rest then appear to be correct on the face of it but hard to tell for certain.

    Any ideas?

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Weekday/Workday/Holidays Formula to calculate finish date

    Try entering the start time of the job as 07/01/2022 14:00.

+ 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: 10
    Last Post: 02-29-2024, 08:55 AM
  2. [SOLVED] Calculate weekday end date based on sum of weekday start date and cell value
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:17 AM
  3. Replies: 3
    Last Post: 10-30-2013, 05:15 AM
  4. Replies: 2
    Last Post: 02-28-2013, 04:24 AM
  5. Formula to calculate date from, weekday-weeknumber-year
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2012, 06:59 PM
  6. Replies: 5
    Last Post: 08-02-2011, 07:11 AM
  7. [SOLVED] [SOLVED] How to Calculate a Projected Finish Date based on Work Week and Holidays
    By mojado44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2005, 09:10 PM

Tags for this Thread

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