Help

Re: Calculate Number of Workdays Per Month

2586 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Cody_Winchester
6 - Interface Innovator
6 - Interface Innovator

Hello, I'm stuck trying to figure out how many workdays exist in a given month. It is easy enough to get the number of workdays between a start and end date using the WORKDAY_DIFF() function, and it also seems possible to collect the total number of days per month. However, I have not come across a solution to determine the number of workdays per month. Any help would be appreciated!

4 Replies 4
bruceconsulting
7 - App Architect
7 - App Architect

Hi Cody, 

You could use a table with Start Dates and End Dates.  Each record would have the start date as the 1st of each month and end date as the last of each month.  Then, create a formula column using the WORKDAY_DIFF() function.  But I'm not sure if this will help since I don't know your exact application.  

If you want to schedule some time with me, here's my Calendly link:  https://calendly.com/d/2cd-f86-8r6/30-minute-help-meeting

Jody

Thanks Jody,

I have a table with a list of projects, each with a start and end date as well as total number of hours. The day of the month for both start and end dates vary depending on the project. While it's easy enough to obtain the number workdays for the entire time span, what eludes me is how to get the number of workdays per month, so that it is then possible to determine the number of hours per month. 

Hmm, assuming you've got a "Date" field per record that would be used to determine the month in question, you could try:

WORKDAY_DIFF(
  DATETIME_PARSE(
    YEAR(Date) & '-' & MONTH(Date),
    'YYYY-MM'
  ),
  DATEADD(
    DATEADD(
      DATETIME_PARSE(
        YEAR(Date) & '-' & MONTH(Date),
        'YYYY-MM'
      ),
      1,
      'month'
    ),
    -1,
    'day'
  )
)

Screenshot 2023-02-07 at 9.03.55 AM.png

Link to base

Thanks for that Adam. A much cleaner approach to getting total workdays per month than what I tried! But, I'm trying to build out not just the total workdays per month; I'm trying to to build out the number of workdays in each month based on when a project starts and ends. Here is an example: Example Project Tracker