如果左图为Sheet1,右图为Sheet2,那么在Sheet2的H4单元格输入以下公式,然后向下填充公式=SUMIFS(OFFSET(Sheet1!M:M,,MATCH(C4,Sheet1!M$3:Q$3,0)-1),Sheet1!A:A,A4,Sheet1!B:B,F4)