gpt4 book ai didi

sharepoint-2010 - 计算 Sharepoint 2010 中不包括周末的天数

转载 作者:行者123 更新时间:2023-12-04 07:01:11 25 4
gpt4 key购买 nike

在计算 Sharepoint 2010 计算列中开始时间和结束时间之间的天数时,如何排除周末(周六和周日)。

1.我在 Sharepoint 2010 中添加了一个日历,有两列作为开始时间和结束时间,现在我的要求是计算明星时间和结束时间之间的天数,不包括周末(周六和周日)意味着它只会计算工作日。试过这个

=IF(AND((WEEKDAY(EndDate,2))<(WEEKDAY(StartDate,2)),((WEEKDAY(StartDate,2))-(WEEKDAY(EndDate,2)))>1),(((DATEDIF(StartDate,EndDate,"D")+1))-(FLOOR((DATEDIF(StartDate,EndDate,"D")+1)/7,1)*2)-2),(((DATEDIF(StartDate,EndDate,"D")+1))-(FLOOR((DATEDIF(StartDate,EndDate,"D")+1)/7,1)*2)))

此外,

=(DATEDIF([StartDate],[EndDate],"d"))-INT(DATEDIF([StartDate],[EndDate],"d")/7)*2-IF((WEEKDAY([EndDate])-WEEKDAY([StartDate]))>0,2,0)+1

但没有得到正确的输出。

最佳答案

=IF(AND((WEEKDAY(EndDate,2))<(WEEKDAY(StartDate,2)),((WEEKDAY(StartDate,2))-(WEEKDAY(EndDate,2)))>1),(((DATEDIF(StartDate,EndDate,"D")+1))-(FLOOR((DATEDIF(StartDate,EndDate,"D")+1)/7,1)*2)-2),(((DATEDIF(StartDate,EndDate,"D")+1))-(FLOOR((DATEDIF(StartDate,EndDate,"D")+1)/7,1)*2)))

这应该可以解决问题:)

关于sharepoint-2010 - 计算 Sharepoint 2010 中不包括周末的天数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17964332/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com