+ Reply to Thread
Results 1 to 8 of 8

Calculate workday date and time based on hours

  1. #1
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Calculate workday date and time based on hours

    Column B = projected hours
    Column C = actual hours
    Column D = start date
    Column E = finish date based on projected, then actual

    Objective: Finish date to calculate based on projected hours for current and all future work orders listed. Start and finish dates automatically adjust based on actual hours. Weekends and non-working hours excluded.
    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: Calculate workday date and time based on hours

    See if this helps: http://www.utteraccess.com/wiki/Work...-_NetWorkHours
    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
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Calculate workday date and time based on hours

    Quote Originally Posted by dflak View Post
    Thanks dflak, I'll check your reference.

    I was able to get mostly what I wanted in the attached sheet. Still needs tweaking though.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Calculate workday date and time based on hours

    I have reached the limit of my high school education. Can someone tell me why I'm getting the #VALUE! error?
    Attached Files Attached Files

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

    Re: Calculate workday date and time based on hours

    The formula you have references column C. The formula is expecting to have a numeric value in this cell. However, sometimes you have the null string.

    You can change this formula: =IF(F9>0,B9-F9,"")
    to: =IF(F9>0,B9-F9,0)

    or wrap the whole big formula in an if statement checking F9 or wrap it in IFERROR().

  6. #6
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Calculate workday date and time based on hours

    Quote Originally Posted by dflak View Post
    The formula you have references column C. The formula is expecting to have a numeric value in this cell. However, sometimes you have the null string.

    You can change this formula: =IF(F9>0,B9-F9,"")
    to: =IF(F9>0,B9-F9,0)

    or wrap the whole big formula in an if statement checking F9 or wrap it in IFERROR().
    That fixed the error, thanks dflak!

    Now another issue. I'm getting a 'Divide by Zero Error' whenever a number ending in 8 or 9 is entered into column F. Why would only those two numbers cause an error?
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate workday date and time based on hours

    Pleasd try at E3

    =IF(A3="","",WORKDAY(D3,INT(F3/10),Info!$A$2:$A$11)+MOD(D3+MOD(F3,10)/24,1)+(MOD(D3+MOD(F3,10)/24,1)>Info!$D$2)*(1-Info!$D$2+Info!$C$2))

  8. #8
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Calculate workday date and time based on hours

    Quote Originally Posted by Bo_Ry View Post
    Pleasd try at E3

    =IF(A3="","",WORKDAY(D3,INT(F3/10),Info!$A$2:$A$11)+MOD(D3+MOD(F3,10)/24,1)+(MOD(D3+MOD(F3,10)/24,1)>Info!$D$2)*(1-Info!$D$2+Info!$C$2))
    SWEET!!! Thanks so much Bo_Ry!!! Works perfect, and much simpler!

+ 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: 5
    Last Post: 02-26-2017, 01:12 PM
  2. Calculate end date and time (working hours)
    By ded1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-03-2016, 07:41 AM
  3. VBA to Calculate Start Date from End Date and Dev Time Using WORKDAY()
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 05:06 PM
  4. [SOLVED] Calculate number of hours from Start date and time and End date and time
    By sathyasun in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-28-2013, 01:04 AM
  5. Replies: 7
    Last Post: 06-27-2011, 06:19 AM
  6. Replies: 2
    Last Post: 01-21-2010, 11:09 AM
  7. Calculate total Hours between 2 date and time
    By Tylim in forum Excel General
    Replies: 3
    Last Post: 05-08-2006, 10:20 PM

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