Try...
=SUMPRODUCT(--('GRIP STAGES'!$C$5:$C$4000=$B8),SUBTOTAL(9,OFFSET('GRIP STAGES'!T$5:T$4000,ROW('GRIP STAGES'!T$5:T$4000)-ROW('GRIP STAGES'!T$5),0,1)))
To exclude manually hidden cells as well, replace the number 9 in red with 109.
Hope this helps!