B6 公式:
=SUM(OFFSET(A3,,MATCH(B5,2:2,0)-1,,-7))
效果如下图:
=================
如果日期不连续:
=sumifs(3:3,2:2,">"&b5-7,2:2,"<="&B5)
或者 =sumifs(3:3,2:2,">="&b5-6,2:2,"<="&B5)
B6 公式:
=SUM(OFFSET(A3,,MATCH(B5,2:2,0)-1,,-7))
效果如下图:
=================
如果日期不连续:
=sumifs(3:3,2:2,">"&b5-7,2:2,"<="&B5)
或者 =sumifs(3:3,2:2,">="&b5-6,2:2,"<="&B5)