SOLVED

# How to calculate the duration in days excluding weekends between 2 date by using formula

Copper Contributor

# How to calculate the duration in days excluding weekends between 2 date by using formula

Hi,

I try to using formula like as bellow, but it's not working:

"=IF(AND(WEEKDAY([End Date])>1, WEEKDAY([End Date])<7), IF(AND(WEEKDAY([Start Date])>1, WEEKDAY([Start Date])<7), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 1), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 2)"

`Thanks,`

best response confirmed by Koong (Copper Contributor)
Solution

# Re: How to calculate the duration in days excluding weekends between 2 date by using formula

Hi,
i trying add plus 1, formula working well.

=IF(AND(WEEKDAY([End Date])>1, WEEKDAY([End Date])<7), IF(AND(WEEKDAY([Start Date])>1, WEEKDAY([Start Date])<7), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 1), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 2) +1

1 best response

Accepted Solutions
best response confirmed by Koong (Copper Contributor)
Solution

# Re: How to calculate the duration in days excluding weekends between 2 date by using formula

Hi,
i trying add plus 1, formula working well.

=IF(AND(WEEKDAY([End Date])>1, WEEKDAY([End Date])<7), IF(AND(WEEKDAY([Start Date])>1, WEEKDAY([Start Date])<7), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 1), DATEDIF([Start Date], [End Date], "D") - (INT(DATEDIF([Start Date], [End Date], "D") / 7) * 2) - 2) +1