Try
=IF(B2=0,"-",MIN(IF(LEFT(Sheet2!$A:$A)=LEFT(A2),Sheet2!$B:$B)))
...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
then copy down
Bookmarks