## Calculate total days between start and end date without weekend

0
Hi, I would like to calculate the total days between start and end date but exclude the weekend date (Saturday and Sunday) How to implement this formula? My formula right now : floor(daysBetween(\$CarbonNeutralInputData/StartDate,\$CarbonNeutralInputData/EndDate) Anyone know? Thanks
0

This is fork of Abhisheks answer :) Nearly same as his logic but the date functions are a little changed.

I use formatDateTime to get the Day of the week from the date and then work with it till end date, all the time checking for weekend(assuming weekend on Sat and Sun)

2

Implementing this function using a formula might be complicated but you can achieve your requirement using loop.

Let me explain in steps;
1. Create a variable of type date with initial value as start date and create a count variable.
2. Check if the trimtoday(\$variable) = 1 or 7.
3. If true continue the loop by using change variable by add date 1.
4. Else increment the count.
5. This loop will execute until variable < end date.
6. The count variable will be the days between start and end.

Hope my answer helps. Reach me out for any queries.