Return the NETWORKDAYS of 1 month of a 2-month duration

Dan Seidler
Dan Seidler ✭✭
edited 12/09/19 in Formulas and Functions

The goal is to count the number of days that an Employee is not assigned work within a given month (MONTH A, MONTH B, etc). 

For example, a given month has 23 working days; I could use NETWORKDAYS of the duration to count the assigned days of that Task; say 19.  To reach my goal, I would simply subract the NETWORKDAYS from the number of workdays within that month: 23-19=4 days.

But... if the duration spans across 2 months, how can I return the NETWORKDAYS of this duration for just MONTH A?  In the above example, 6 days are in MONTH A, and 13 days are in MONTH B.

Comments

  • L_123
    L_123 ✭✭✭✭✭✭
    edited 04/04/19

    =NETWORKDAYS([start date]3, DATE(YEAR([start date]3), MONTH([start date]3) + 1, 1) - 1)

     

    You really need to think about how the program works in order to do this one. When you subtract 1 from a date it goes 1 day before. so you pick the first day of the next month and subtract 1 and it will go to the last day of the current month. you can add in an if statement before the DATE to say if the end date is before the end of the month then to use that date as well if you like.

     

    Keep in mind this will only work for projects less than 1 year unless you add in that criteria with your if statement

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!