Forum Discussion
WeekdaySub() excludes the end date in the calculation by design. If you're expecting 5 days using these dates, it will return 4.
If you're good with this from this function, then you can simply check for the checkbox and add 1 to the calc otherwise just return the calc. If not, and you truly want 5 days, then return 6 from these dates, you'll need to add 2 using this function or perform a different calculation.
// assumes your "Saturday" field is entitled "Saturday?" - add 1 day where Sat is checked
If(
[Saturday?], WeekdaySub([End Date], [Start Date]) + 1,
WeekdaySub([End Date], [Start Date])
)
ahh I didnt notice this my Start Date always starts with a Sunday and the end date is always a saturday... so I was getting the 5 days everytime then I made another field that simply divides the days by 5 so if one set of dates had 25 days then there was 5 saturdays between those dates. then just use the check box to count the other 5 days if checked. but after reading this i can see this may have some issues.
- Mez27 days agoQrew Captain
Since you have varying date ranges for which you want to know the number of Saturday's, check out this older post, that Ben pushed to today, with some clever logic. how-to-find-no-of-sundays-in-a-month