本帖最后由 nsxlyj 于 2018-12-19 11:20 编辑
=ROUND(SUM(LOOKUP(MAX(DATEDIF(B2,DATE(YEAR(NOW()),MONTH(B2),DAY(B2)),"m")-1,0)+{0,1},H$3:O$4)*(B2-DATE(YEAR(B2),1,1)-365*{0,1})*{1,-1})/365,)
优化一下
=ROUND(SUM(LOOKUP(MAX((YEAR(NOW())-YEAR(B2))*12-1,0)+{0,1},I$3:P$4)*ABS(B2-DATE(YEAR(B2),1,1)-{0,365}))/365,)
再优化一次,看来还是思路有问题
=ROUND(SUM(LOOKUP(ABS((YEAR(NOW())-YEAR(B2))*12-{1,0}),I$3:P$4)*ABS(B2-DATE(YEAR(B2),1,1)-{0,365}))/365,)
再简化一下
=ROUND(SUM(LOOKUP((YEAR(NOW())-YEAR(B2))*{11.9,12},I$3:P$4)*ABS(B2-DATE(YEAR(B2),1,1)-{0,365}))/365,)
=ROUND(SUM(LOOKUP((YEAR(NOW())-YEAR(B2))/{6.1,6},I$3:P$4/73)*ABS(B2-DATE(YEAR(B2),1,1)-{0,365}))/5,)
|