|
楼主 |
发表于 2024-12-9 23:50
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
做了个很笨的公式:=SUM(IF(OR(ISNUMBER(MATCH(INT(A2),$J$2:$J$31,0)),AND(OR(WEEKDAY(INT(A2))=7, WEEKDAY(INT(A2))=1),NOT(ISNUMBER(MATCH(INT(A2),$K$2:$K$9,0))))),0,$M$3-MAX(MOD(A2,1),$M$2)),IF(OR(ISNUMBER(MATCH(INT(D2),$J$2:$J$31,0)),AND(OR(WEEKDAY(INT(D2))=7, WEEKDAY(INT(D2))=1),NOT(ISNUMBER(MATCH(INT(D2),$K$2:$K$9,0))))),0,MIN(MOD(D2,1),$M$3)-$M$2))*24*60*60+($M$3-$M$2)*SUM(NETWORKDAYS(INT(A2)+1,INT(D2)-1,$J$2:$J$31),INT(D2)-1-(INT(A2)+1)+1-NETWORKDAYS.INTL(INT(A2)+1,INT(D2)-1,"0000000",$K$2:$K$9))*24*60*60 |
|