Hi and welcome to the forum.

An easy way to do this, is using a helper & hidden column(Let's say C)

sO IN c2 and copy down put this.

=COUNTIF(B2:B3,B2)

Then, use this formula to get your result.

=COUNTIFS(A2:A13,"y",C2:C13,1)

Is this, works, for you?