在G2单元格输入公式:=SUMPRODUCT((24*TIMEVALUE(LEFT($A$2:$A$17,18))>=20)*(24*TIMEVALUE(RIGHT($A$2:$A$17,18))<=21)*($B$2:$B$17=$F2)*$D$2:$D$17)复制并下拉至G3单元格,即可。