i have this formula

=IF(ISNUMBER(SMALL($A$5:$A$12,ROW()-ROW($A$5)+1)),SMALL($A$5:$A$12,ROW()-ROW($A$5)+1),"")

which i use to sort in alphabetical order a list of names between a5:a12

i would like to change this formula so that it will only include those agents where column b contains "Yes".

im having a little trouble with this can anyone help.