答案1
迭代日期ROW(INDEX($ZZ:$ZZ,L$2+1):INDEX($ZZ:$ZZ,M$2))
如果日期介于开始和结束之间且工人匹配,则使用 SUMIFS() 返回费率:
=SUMPRODUCT(SUMIFS($G$3:$G$6,$E$3:$E$6,"<="&ROW(INDEX($ZZ:$ZZ,L$2+1):INDEX($ZZ:$ZZ,M$2)),$F$3:$F$6,">="&ROW(INDEX($ZZ:$ZZ,L$2+1):INDEX($ZZ:$ZZ,M$2)),$A$3:$A$6,$J3))
如果有人拥有 Office 365 Insider 版本的 Excel,或者微软最终发布了它,则ROW(INDEX($ZZ:$ZZ,L$2+1):INDEX($ZZ:$ZZ,M$2))
可以用 替换SEQUENCE(M$2-L$2,,L$2+1)
。
=SUMPRODUCT(SUMIFS($G$3:$G$6,$E$3:$E$6,"<="&SEQUENCE(M$2-L$2,,L$2+1),$F$3:$F$6,">="&SEQUENCE(M$2-L$2,,L$2+1),$A$3:$A$6,$J3))