I'd use INDEX instead:

=SUMPRODUCT(1/COUNTIF('Sheet1 '!B1:INDEX('Sheet1 '!B:B,A1),'Sheet1 '!B1:INDEX('Sheet1 '!B:B,A1)))

You could shorten with LET