Hi,
I'm also not sure if I understood your question correctly - but if you want to count the number of unique values that you have in column B, but only for those rows where column F = "Yes", then you can use the following Array formula (confirm with Ctrl+Shift+Enter):
=SUMPRODUCT(IFERROR(1/IF(F2:F100="Yes",COUNTIFS($F$2:$F$100,"Yes",$B$2:$B$100,B2:B100)),0))