可以加一个辅助列,(这列可以隐藏),公式:
=IF(COUNTIF(A$1:A1,A1)=1,IF(AND(A1>=$B$1,A1<=$C$1),1,0),"")
=SUM((IF(MATCH(A1:A12,A1:A12,)=ROW(1:12),A1:A12,9E+103)>=B1)*(IF(MATCH(A1:A12,A1:A12,)=ROW(1:12),A1:A12,9E+103)<=C1)) 按组合键ctrl+shift+enter结束公式
D1公式
=SUMPRODUCT(1/COUNTIF(A1:A12,A1:A12),--(A1:A12>=B1),--(A1:A12<=C1))