Skip to main content
Solved

How to create a Script to calculate number of days between two dates (exclude weekends & holidays)?

  • August 17, 2020
  • 2 replies
  • 44 views

I need to be able to calculate the number of working days between two dates determined in “Start Date” and “End Date” columns. I know the DATETIME_DIFF formula exists, but it includes weekends and public holidays – I need only working days to be calculated.

Is this something that can be achieved with a Script block?

Best answer by Kamille_Parks11

Well if you don’t want to use DATETIME_DIFF(...) why not just use WORKDAY_DIFF(startDate, endDate, [holidays]).

WORKDAY_DIFF() doesn’t include weekends and you can specify which holidays to exclude.

2 replies

Kamille_Parks11
Forum|alt.badge.img+27
  • Brainy
  • 2679 replies
  • Answer
  • August 17, 2020

Well if you don’t want to use DATETIME_DIFF(...) why not just use WORKDAY_DIFF(startDate, endDate, [holidays]).

WORKDAY_DIFF() doesn’t include weekends and you can specify which holidays to exclude.


  • Author
  • New Participant
  • 2 replies
  • August 19, 2020

Well if you don’t want to use DATETIME_DIFF(...) why not just use WORKDAY_DIFF(startDate, endDate, [holidays]).

WORKDAY_DIFF() doesn’t include weekends and you can specify which holidays to exclude.


Thanks very much! I didn’t realize this function existed, haha :grinning_face_with_sweat: