+ Reply to Thread
Results 1 to 39 of 39

Projected Working Days_Hours

  1. #1
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Projected Working Days_Hours

    Hello Team,

    We need to calculate projected working days, based on today to end date we have in our data sheet.
    Please see attached sheet for data and we are looking results like "Projected Working Days" tab.

    Working days to be calculated excluding sat/sun and holidays we mentioned in holiday tab.

    thanks for your help in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Projected Working Days_Hours

    Something like the attached?

    Note that I changed the entry of your start/end dates in the Companies worksheet to be actual date values, but changed the custom format to what you had previously entered.
    Attached Files Attached Files
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Using mcmahobt's file and formulae:

    =NETWORKDAYS(INDEX(Companies!$E$2:$E$3,MATCH(C2,Companies!$A$2:$A$3,0)),INDEX(Companies!$F$2:$F$3,MATCH(C2,Companies!$A$2:$A$3,0)),INDIRECT(D2&"_HOL"))

    Using Named Ranges for the holidays:

    Simpler than this:

    =NETWORKDAYS(INDEX(Companies!$E$2:$E$3,MATCH(C3,Companies!$A$2:$A$3,0)),INDEX(Companies!$F$2:$F$3,MATCH(C3,Companies!$A$2:$A$3,0)),IF(Holidays!$A$2:$A$7='Projected Working Days'!D3,Holidays!$B$2:$B$7,0))

  4. #4
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Hello mcmahobt and John, Thank you for your response.

    I need projected days to be calculated monthly,
    for e.g.
    Month Days
    June 2017 22 (excluding sat/sun and holidays specified in holidays tab)
    July 2017 20 (excluding sat/sun and holidays specified in holidays tab)

    I have already attached this format in my initial file.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    I suggest you look at NETWORKDAYS.INTL function and try it yourself. It is a very straightforward function to use and you can use the current holiday part (IF (....)
    of the NETWORKDAY function already provided.
    Last edited by JohnTopley; 05-24-2017 at 07:56 AM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    OR

    Simply change the Start and End date in the current formula:

    NETWORKDAYS(Start_Date,End_date),IF(Holidays!$A$2:$A$7='Projected Working Days'!D2,Holidays!$B$2:$B$7,0))

    You know the Start date and should be able to calculate the month-end date.

  7. #7
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Yes, John. this function looks very simple and easy to apply.

    =NETWORKDAYS.INTL (start_date, end_date, [weekend], [holidays])

    but the challenges I am having here is to get the values for each month, based on startdate and enddate. As of now, I am new to excel formulas and can only apply basic formulas with simple calculations.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    The Start date is the date in H2 and the end date is EOMONTH(H2,0)

    apply to this ,,,

    NETWORKDAYS(Start_Date,End_date),IF(Holidays!$A$2:$A$7='Projected Working Days'!D2,Holidays!$B$2:$B$7,0))

  9. #9
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Hey John,
    Thanks for your inputs again.

    I looking something similar to the solution you provided for Post "Calculate Working Hours Monthly", that worked perfectly and was exactly we were looking.

    So, I'm looking like to calculate Projected working hours for a member from next month (June) to end date (December), if in case members end date is increased to January 2018 (that month should be added to Projected working days).

    I have attached sample data sheet and expected results (Projected Working Days tab).
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Use

    =NETWORKDAYS(H2,EOMONTH(H2,0),INDIRECT(D2&"_HOL"))
    Attached Files Attached Files
    Last edited by JohnTopley; 05-25-2017 at 03:09 AM.

  11. #11
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    I tried this, =NETWORKDAYS($H2,EOMONTH($H2,0)),IF(Holidays!$A$2:$A$7='Projected Working Days'!D2,Holidays!$B$2:$B$7,0)
    and it's giving me an error.

    1.JPG

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Use the formula I posted in the attachment in post #10.

  13. #13
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Projected Working Days_Hours

    Hi,

    See the attached file.

    I could accomplish this by adding few helper columns and a lengthy formula!

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    I have elaborated the formula to calculate the number of working days even if the Start Date & End Dates are NOT the End/Beginning of the months.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    See attached:

    =NETWORKDAYS(H2,EOMONTH(H2,0),INDIRECT(D2&"_HOL"))
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Thanks for all your efforts and help Team..!!!

    John, I was looking something solution you provided in post "Calculate Working Hours Monthly", where I was just adding a month and it's entry was getting added to Results tab (please see attached "Sample Time Tracker JT (1)" sheet ) so I can say it was much automated process which we feel most relevant to us and also liked most.

    So, here I'm looking something similar automated (if we can say) Projected days/hours to be calculated. Let say if any resource is added to the Companies tab with startdate/enddate his/her projected hours should be calculated based on next month (of current month) and enddate. Please see attached sample file again.

    Thanks again for all your efforts.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    You have all the formula you need: simple apply the required start and end dates.

    I have no idea what you want in "Projected Working days" other than that which has already been provided.

    The "Sample time Tracker" file is OLD and I have provided various formulae for this file to address your requirements.

  17. #17
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    if you add a resource in companies tab that should be added in projected working days tab automatically with projected working days monthly.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    You will need VBA to do this: in particular if you want a change to "Companies" (Add OR Delete) to automatically generate a new "Projected Working Days".

    I take it the first month is the Current month +1 i.e. addition in June will mean the first month is July ? [rather then based on Employee Start Date].

  19. #19
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Attached is VBA routine to create "Projected Work days".

    The Start month is current month+1 i.e. as we are in May, start month is June. [Previous data is lost].

    End month (for purposes of testing) is hard-coded (Highlighted) in Red.

    and data in "Companies" is incomplete.

    Currently macro invoked with RUN button but could be invoked by any change to "Companies" data

    Please Login or Register  to view this content.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    thank you John,

    I'm trying to do this with formula, I tried to generate 7 rows (current month to enddate (december)) for first resource in Projected Working Days tab, but gives an error, please see attached sheet.

    formula is: =INDEX(Companies!$A$2:$A$999,INT((ROWS($1:1)-1)/(YEAR(Companies!$F2)-YEAR(EDATE(TODAY(),1)))*12+MONTH(Companies!$F2)-MONTH(EDATE(TODAY(),1))))

    YEAR(Companies!$F2)-YEAR(EDATE(TODAY(),1)))*12+MONTH(Companies!$F2)-MONTH(EDATE(TODAY(),1))) -- Gives me 7

    plz let me know whats wrong here.
    Attached Files Attached Files

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Try entering your dates as Excel dates: 04/05/2017: The answer is 7 (12 month -5 month)=7 for same year so Dates are not the problem.

    You need to generate the number of rows corresponding to the number of people AND repeat that for each month, remembering that all staff are not working the same periods.

    Good luck!
    Last edited by JohnTopley; 05-25-2017 at 11:32 AM.

  22. #22
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Start set of formulae:

    in J2
    Please Login or Register  to view this content.
    in K2

    Please Login or Register  to view this content.


    in L2

    =IF(EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999)))+1<=INDEX(Companies!$F$2:$F$999,MOD((ROWS($1:1)-1),COUNTA(Companies!$A$2:$A$999))+1),EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999)))+1,"")

    This last one sets dates to blank if past end date in "Companies"

    Max_Months is named range is maximum date in column F of "Companies" (can obviously be changed)
    Attached Files Attached Files
    Last edited by JohnTopley; 05-25-2017 at 02:59 PM.

  23. #23
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    hey John, appreciate your help again.

    But, I'm not clear with the columns K and L, both these are generating months and why we need to two column with months value.
    Also, about the count of working days for each month, where are we getting that, I mean in which column.

  24. #24
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    They are there simply to show the options available: just choose one.

    I expected you to work out that the formulae in J,K,L need to transferred to the appropriate column in the table in A:H. You could then use INDEX/MATCH to fill in the missing data from "Companies".

    You already have various formulae for working days.

  25. #25
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Great!

    I was able to apply some formulas, now I have got two questions...

    1. In "Projected Working Days" tab cell F5, it's not showing correct value, not sure why.
    2. I was able to calculate working days based on this
    =NETWORKDAYS($H2,EOMONTH($H2,0),IF(Holidays!$A$2:$A$7='Projected Working Days'!D2,Holidays!$B$2:$B$7,0)) -- this works well till row 6

    but then I tried below and got expected results.
    =NETWORKDAYS($H8,EOMONTH($H8,0),IF(Holidays!$A$2:$A$999='Projected Working Days'!D8,Holidays!$B$2:$B$999,0))

    So here, why do we need to give range till $A$999 or $B$999, even when we have values only till row 7 in holidays tab ?
    please see attached file.
    Attached Files Attached Files

  26. #26
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    The formula you are using has to array-entered i.e with Ctrl+Shift+Enter.

    Using the formula in H (from K) shows Lina Cartegena working in January 2018 when she finishes in December 2017 (according to the table in "Companies").

    Hence the formula in L which sets this month field to blank if the "contract date" has passed.

    Plus to need to add Location and Role to "Companies" table.
    Last edited by JohnTopley; 05-26-2017 at 11:27 AM.

  27. #27
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Great!, thanks for your help John and that works perfectly for me.

    I need to do a small correction in formula, I need to calculate projected hours for current month too.
    Initially I said, need to calculate from next month. So, just want to correct that.

  28. #28
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    I need to calculate projected hours for current month too.
    All of the month (of May) or remainder?

    Either way you should be able to amend the current formulae (as the "this month version" has been posted previously I am sure).

  29. #29
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Thank you, John. I'll check that.
    I'm trying to add one column in the data now, where if effective is greater than current month that should be added to tab called "SP"

    I tried this formula, but I don't see the expected results, Please see attached sheet too.

    "IF(EOMONTH(TODAY(),INT((ROWS($1:3)-1)/COUNTA(Companies!$A$2:$A$2999)))< INDEX(Companies!$E$2:$E$2999,MOD((ROWS($1:4)-1),COUNTA(Companies!$A$2:$A$2999))+1),INDEX(Companies!$E$2:$E$2999,MOD((ROWS($1:3)-1),COUNTA(Companies!$A$2:$A$2999))+1))"

    I'm trying to get records only if effective date is greater than current month.

  30. #30
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    In A2

    =IFERROR(INDEX(Companies!A$2:A$2999,SMALL(IF(Companies!$E$2:$E$2999>EOMONTH(TODAY(),0),ROW(Companies!$E$2:$E$2999)-ROW($E$2)+1,""),ROWS(A$2:$E2))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy across

  31. #31
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Hey John, Just to update on my previous note.
    Adding current month record too.

    I tried with this formula,
    =IF(EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999)))+1<=INDEX(Companies!$F$2:$F$999,MOD((ROWS($1:1)-1),COUNTA(Companies!$A$2:$A$999))+1),EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999))-1)+1,"")

    I'm getting current months records here, but it disturbs last months records. It's shows values only till 2nd last month of each member.
    Please see attached sheet.

  32. #32
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Unable to activate array. Yes, I tried with CTRL+SHIFT+ENTER to activate array.

    Then I removed iferror to see error, it throws "The value used in the Formula is of wrong type". See tab "SP" in attached sheet.

  33. #33
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Nothing wrong with the formula ....

    =IFERROR(INDEX(Companies!A$2:A$2999,SMALL(IF(Companies!$E$2:$E$2999>EOMONTH(TODAY(),0),ROW(Companies!$E$2:$E$2999)-ROW($E$2)+1,""),ROWS(A$2:$A2))),"")

    Copy/paste formula into A2 of "SF" then do Ctrl+Shift+Enter

  34. #34
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Thanks John, that works perfectly now.

    Can you please help to answer for my post #31

  35. #35
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    in H2

    =IF(EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999))-1)+1<=INDEX(Companies!$F$2:$F$999,MOD((ROWS($1:1)-1),COUNTA(Companies!$A$2:$A$999))+1),EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999))-1)+1,"")

    In O2

    =DATEDIF(EOMONTH(TODAY(),-1)+1,MAX(Companies!$F$2:$F$999),"m")

  36. #36
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Great!, that works perfectly now,

    I just missed to update highlighted value.

    =IF(EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999))-1)+1<=INDEX(Companies!$F$2:$F$999,MOD((ROWS($1:1)-1),COUNTA(Companies!$A$2:$A$999))+1),EOMONTH(TODAY(),INT((ROWS($1:1)-1)/COUNTA(Companies!$A$2:$A$999))-1)+1,"")

  37. #37
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

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

  38. #38
    Registered User
    Join Date
    05-02-2017
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Projected Working Days_Hours

    Thanks for all your efforts and help John.

  39. #39
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Projected Working Days_Hours

    Thank you for your feedback. Hopefully, you are now in "production".

+ 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. calculate the projected operations????
    By jetusu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2013, 02:51 PM
  2. Calculating projected age
    By NancyNo5 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2013, 02:03 PM
  3. calculating a projected value
    By kadams99 in forum Excel General
    Replies: 2
    Last Post: 07-19-2012, 05:52 PM
  4. Projected Component Change outs
    By evink in forum Excel General
    Replies: 7
    Last Post: 09-08-2011, 12:58 PM
  5. Projected End Date
    By jealkon in forum Excel General
    Replies: 3
    Last Post: 02-24-2011, 10:22 AM
  6. Calculate projected figure
    By Mark Stephenson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2005, 08:25 AM
  7. [SOLVED] projected sales?
    By briansoliz in forum Excel General
    Replies: 2
    Last Post: 01-21-2005, 10:06 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