Help

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

Topic Labels: Scripting extentions
Solved
Jump to Solution
2561 2
cancel
Showing results for 
Search instead for 
Did you mean: 
AISYAH_AMBOK
5 - Automation Enthusiast
5 - Automation Enthusiast

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?

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

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.

See Solution in Thread

2 Replies 2
Kamille_Parks
16 - Uranus
16 - Uranus

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: