Count number Fridays in a given period

Hello Team, I have been struggling with counting a number day ( Monday, Tuesday, Wednesday etc) in a [Start date] and [End date]

Solved Solved
0 8 523
1 ACCEPTED SOLUTION

I am counting the days from my Shifts table.
By having the conditions <= and >= the selected dates are included.
Not to be included the just use < and >.

In the example below, only had 3 Monday shifts.

3X_a_c_ac1e1c8b61c78521f1d528141a6901ea10ac5d76.png

3X_8_9_89373a71f269a373c1b5aa882529fac6cd1c996b.png

View solution in original post

8 REPLIES 8

@Servatec
Should [StartDate] and [EndDate] be counted if either of them falls into Friday? Try with this first:

NUMBER((WEEKDAY([StartDate] - 6)-[StartDate]+[EndDate])/7)

Bear in mind that, the above expression also counts the Fridays if the Start and End dates also falls into Friday. Provided you want to omit them, you need to set an IFS expression:

IFS(
	AND(
		WEEKDAY([StartDate])=6,
		WEEKDAY([EndDate])=6
	),NUMBER((WEEKDAY([StartDate] - 6)-[StartDate]+[EndDate])/7)-2,
	OR(
		WEEKDAY([StartDate])=6,
		WEEKDAY([EndDate])=6
	),NUMBER((WEEKDAY([StartDate] - 6)-[StartDate]+[EndDate])/7)-1,
	TRUE,NUMBER((WEEKDAY([StartDate] - 6)-[StartDate]+[EndDate])/7)
)

COUNT(SELECT(DatesTable[Date],AND([Date]>=[Start Date],[Date]<=[End Date],WEEKDAY([Date])=[DayToCount])))

I ended up with this, having [DayToCount] Enum to select the day.

Great. Not necessarily fall on Friday but to count number of occurrences of a day with a given period start to end date

I am counting the days from my Shifts table.
By having the conditions <= and >= the selected dates are included.
Not to be included the just use < and >.

In the example below, only had 3 Monday shifts.

3X_a_c_ac1e1c8b61c78521f1d528141a6901ea10ac5d76.png

3X_8_9_89373a71f269a373c1b5aa882529fac6cd1c996b.png

Trying implement your formula here I think finding it difficult to.

I want to use created (date) and today()
To get the number of Sundays.

Replace [From} with [Created] and [To] with TODAY()

Woooaoooh thanks a lot more than a magic

Top Labels in this Space