借楼上答案的图,公式亦可为:=SUMPRODUCT((Sheet2!B:B = A2)*Sheet2!C:C)