=sumporduct((sheet1!$A$2:$A$5000=A2)*(sheet1!$D$2:$D$5000=请假))A2为表2要查询的班级引用sheet1为表1名称$A$2:$A$5000为表1班级数据区域$D$2:$D$5000为表1请假数据区域根据自己的表格格式修改
=sumporduct((sheet1!$A$2:$A$5000=A2)*(sheet1!$D$2:$D$5000=请假))A2为表2要查询的班级引用sheet1为表1名称$A$2:$A$5000为表1班级数据区域$D$2:$D$5000为表1请假数据区域根据自己的表格格式修改