+ Reply to Thread
Results 1 to 6 of 6

Assigning Hours to Days of the Week for a Calendar

Hybrid View

  1. #1
    Registered User
    Join Date
    06-25-2019
    Location
    Massachusetts, USA
    MS-Off Ver
    2013
    Posts
    3

    Question Assigning Hours to Days of the Week for a Calendar

    Good Morning,
    First time poster so thanks in advance for your help. I am trying to build a schedule where I have a task name, hours to complete, start and finish dates. I know if you add the hours to complete to the start date I get my finish date, but I want to assign varying hours to different days of the week. Saturdays and Sundays I want to carry 8 hours per day and all weekdays only 1 hour. For example, if I have a task that takes 10 hours to complete and its starting on a Sunday, it won't finish until Tuesday (8 hours on Sunday, 1 on Monday and 1 on Tuesday). Any ideas?

    Thank you

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Assigning Hours to Days of the Week for a Calendar

    Hi

    If I understood your question, I suppose you can use this (large) formula to get the final date, based on a starting date and the number of hours to complete the task, knowing that the work on Saturday and Sunday is 8 hours and only one hour on other days of the week.

    Suppose start_date in B4:Bn, and Hours_to_complete in C4:Cn
    Use in D2 and copy down
    Formula: copy to clipboard
    =IFERROR(IFERROR(
    MATCH(C4,INDEX(8*(ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13)-1),),0),
    MATCH(C4,INDEX(8*(ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13)-1),),1)+1)
    -1+B4+ROUNDDOWN(C4/21,0)*7,B4)


    See the file
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-25-2019
    Location
    Massachusetts, USA
    MS-Off Ver
    2013
    Posts
    3

    Re: Assigning Hours to Days of the Week for a Calendar

    Jose,
    Thank you so much! I think this will actually accomplish what I'm looking to do here. Can you explain what the validation is about though? I started changing the hours assigned to weekdays and once I did several of my tasks went to "bad".

    Thank you

    Quote Originally Posted by José Augusto View Post
    Hi

    If I understood your question, I suppose you can use this (large) formula to get the final date, based on a starting date and the number of hours to complete the task, knowing that the work on Saturday and Sunday is 8 hours and only one hour on other days of the week.

    Suppose start_date in B4:Bn, and Hours_to_complete in C4:Cn
    Use in D2 and copy down
    Formula: copy to clipboard
    =IFERROR(IFERROR(
    MATCH(C4,INDEX(8*(ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13)-1),),0),
    MATCH(C4,INDEX(8*(ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN(C4/21,0)*7+ROW($A$1:$A$13)-1),),1)+1)
    -1+B4+ROUNDDOWN(C4/21,0)*7,B4)


    See the file

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Assigning Hours to Days of the Week for a Calendar

    Hi @alfont1120

    The E: F validation columns are the way I used them to avoid errors in my formula. In my tests, I never received the "bad" validation, which meant that the date I never differed more than 7 hours (Saturday or Sunday).
    I made an exhaustive validation beginning on 07-27-2019 until 12-31-2022 and did not detect any errors. The formula only detected errors by default and not by excess. I corrected the validation formula (I used ABS) and found that a multiple duration of 21 hours always translated into an error.
    The correction of the formula follows.
    If you continue to get errors, please send me the details of this situation.
    Validation In E4... and F4...:
    Formula: copy to clipboard
    =SUMIFS($O$2:$O$1286,$M$2:$M$1286,">="&B4,$M$2:$M$1286,"<="&D4)
    =IF(ABS(E4-C4)<8,"Ok","Bad")

    End_Date in D4:
    Formula: copy to clipboard
    =IFERROR(IFERROR(
    MATCH(C4,INDEX(8*(ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13)-1),),0),
    MATCH(C4,INDEX(8*(ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13)-1),),1)+1)
    -1+B4+ROUNDDOWN((C4-1)/21,0)*7,B4)


    Note that validation is not necessary to solve your problem nor the table $M$2:$P$1286.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-25-2019
    Location
    Massachusetts, USA
    MS-Off Ver
    2013
    Posts
    3

    Re: Assigning Hours to Days of the Week for a Calendar

    Thanks for putting so much effort into this for me, it is greatly appreciated and will definitely work for what I am trying to do.

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Assigning Hours to Days of the Week for a Calendar

    Thanks for the kind words.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Roster Days to Hours per Week?
    By Gazsim in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-17-2018, 10:32 AM
  2. Formula which can calculate hours and days in a week
    By anniewalker in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 03-10-2016, 02:01 AM
  3. Replies: 2
    Last Post: 11-12-2014, 11:56 AM
  4. Split total hours in a week to individual days
    By abyblr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2013, 09:17 AM
  5. Chart days of week x hours
    By cascao in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-12-2013, 04:47 AM
  6. Using days of the week to compute work hours
    By ronhc213 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2008, 06:46 PM
  7. [SOLVED] How do I calculate the week day hours between 2 days
    By Mickey in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 08:05 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