Hi and welcome to the forum

Formula: copy to clipboard
=AVERAGEIF(A2:A18,"Yes",B2:B18)