AH5=IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))<=SUM(--ISNUMBER($C$4:$AG$4))*8,IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))<=SUM(--ISNUMBER($C$4:$AG$4))*8,IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))+SUM(IF($C$4:$AG$4="休",0,IF(ISERR(-C5:AG5),0,IF(C5:AG5-8<0,0,C5:AG5-8))))<=SUM(--ISNUMBER($C$4:$AG$4))*8,SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))+SUM(IF($C$4:$AG$4="休",0,IF(ISERR(-C5:AG5),0,IF(C5:AG5-8<0,0,C5:AG5-8)))),SUM(--ISNUMBER($C$4:$AG$4))*8),SUM(--ISNUMBER($C$4:$AG$4))*8),SUM(--ISNUMBER($C$4:$AG$4))*8)
AJ5=IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))=SUM(--ISNUMBER($C$4:$AG$4))*8,SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5))),IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))<SUM(--ISNUMBER($C$4:$AG$4))*8,0,SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))-SUM(--ISNUMBER($C$4:$AG$4))*8))
AI5=IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))>SUM(--ISNUMBER($C$4:$AG$4))*8,SUM(IF($C$4:$AG$4="休",0,IF(ISERR(-C5:AG5),0,IF(C5:AG5-8<0,0,C5:AG5-8)))),IF(SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4="休",0,IF(ISERR(-C5:AG5),0,IF(C5:AG5-8<0,0,C5:AG5-8))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))<SUM(--ISNUMBER($C$4:$AG$4))*8,0,SUM(IF($C$4:$AG$4="休",0,IF((C5:AG5="公")+(C5:AG5="Φ")+(C5:AG5="调休"),8,IF(ISERR(-C5:AG5),0,IF(C5:AG5>8,8,C5:AG5)))))+SUM(IF($C$4:$AG$4="休",0,IF(ISERR(-C5:AG5),0,IF(C5:AG5-8<0,0,C5:AG5-8))))+SUM(IF($C$4:$AG$4<>"休",0,IF(C5:AG5="休",0,C5:AG5)))-SUM(--ISNUMBER($C$4:$AG$4))*8))
數組
附件有兩活頁,無輔助欄公式如上,可下拉,並自動判斷每月上班總天數
有輔助欄在另一活頁,公式看來較和藹,請參考 ^^
[ 本帖最后由 piny 于 2010-7-28 19:42 编辑 ] |