=offset(Sheet2!$A$1,match(A2,Sheet2!$A$2:$A$4),match(b2,Sheet2!$B$1:$E$1))大概是这个意思,要根据你的范围改
conutif(),conutifs(),if(),SUMPRODUCT()