Help

Re: Count number of Saturdays & Sundays in a date range

668 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Matthew_Camille
4 - Data Explorer
4 - Data Explorer

I’m relatively new to airtable and i’m working on a tracking and costing system for the project I am working on.

I am creating security schedules which are usually the same for monday through to friday. they change on saturdays, sundays and public holidays.

I want to count the number of saturdays and sundays in a given period to set the schedule for those particular days but the starting point is knowing how many there are…

can anyone help out with this?
thanks

1 Reply 1

Hi @Matthew_Camilleri - you can find the number of weekends between a start and end date with formulas:

Screenshot 2022-03-07 at 08.18.58

First, work out the number of days in the period, then work out the number of workdays in the same period, then take them away. Rather than two columns as I have, you can combine this into a single formula field with:

DATETIME_DIFF(End, Start, 'days') + 1 - WORKDAY_DIFF(Start, End)

Note that I am adding 1 to the DATETIME_DIFF part of the formula in order to get the number of days inclusive of both the start and end date. By default DATETIME_DIFF gives a non-inclusive number of days, e.g. diff between 1st March and 1st March is zero.