Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

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

Topic Labels: Scripting extentions
Solved
Jump to Solution
776 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

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: