汇总里判断是到期了就加超期金额=if(iserror(datedif(c2,today(),"d")), 原汇总+超期金额,原汇总)
=sumif(D4:D9,">0",A4:A9)
用sumproduct函数=sumproduct(($d$4:$d$9>0)*($a$4:$a$9))