hi there, I allow me to propose this another possible solution to copy and drag from C2:

=IFERROR(INDEX(SUBSTITUTE(A$2:A$6," NO",""),MATCH(,INDEX(COUNTIF(C$1:C1,SUBSTITUTE(A$2:A$6," NO","")),),)),"")
I hope it results useful.