=SUMPRODUCT((ISNUMBER(Y!$1:$3))*(Y!$1:$3<=Z!A1)*(X!$B$1:$B$3="T"))