=SUMIFS(Sheet1!D:D,Sheet1!A:A,"<2011-2-1",Sheet1!B:B,Sheet2!A2)-SUMIFS(Sheet1!D:D,Sheet1!A:A,"<2010-12-31",Sheet1!B:B,Sheet2!A2)其实就是前面的小于月尾,后面的取月首时间
用VLOOKUP函数