Hei there,
I have an if(index(match formula that I want to build upon. I want to add an extra conditions

=IF(INDEX(Sheet1!$A$5:$A$500;MATCH($E3;Sheet1!$A$5:$A$500;0))<>"";$B$16;"")

I want to add that if ("D3") = "Yes", then the result should be ("B16"). If not, the result should be ("C16").

I tried this, but it doesn't work:
=if(and(index(Sheet1!$A$5:$A$500;match(E3;Sheet1!$A$5:$A$500;0))<>"";D3="Yes";$B$16;$C$16;"")