Assuming that Column A contains the gender, such as Male, Column B contains the state, such as New York, and Column C contains the test scores, try...
=PERCENTILE(IF(A1:A10="Male",IF(B1:B10="New York",IF(C1:C10<>"",C1:C10))),0.9)
...confirmed with CONTROL+SHIFT+ENTER, not just ENTER. Adjust the range accordingly.
Hope this helps!