How do I return the number of workdays in a month using only the start date?

2»

Answers

  • First I had this, worked fine until December

    =NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), MONTH([start day]@row) + 1, 1) - 1)

    then i tried this

    =IF(MONTH(start day@row) = 12, NETWORKDAYS(start day@row, DATE(YEAR(start day@row), 12, 31)), NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), MONTH([start day]@row) + 1, 1) - 1))

    neither works



  • First I had this, worked great until December went Invalid

    =NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), MONTH([start day]@row) + 1, 1) - 1)

    then i tried this

    =IF(MONTH(start day@row) = 12, NETWORKDAYS(start day@row, DATE(YEAR(start day@row), 12, 31)), NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), MONTH([start day]@row) + 1, 1) - 1))


  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓

    Hey Dave

    In your IF formula, you referenced 'start day' but it doesn't have the square brackets required for a column name containing a space.

    This should work for you

    =IF(MONTH([start day]@row) = 12, NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), 12, 31)), NETWORKDAYS([start day]@row, DATE(YEAR([start day]@row), MONTH([start day]@row) + 1, 1) - 1))

    Kelly

  • Thank you!

    works fine now!

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    Hey Dave

    Would you take a screenshot of your formula with the colored text? It would be terrific if it also included your column header for your date field

    Thanks,

    Kelly

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!