Does this works:

Formula: copy to clipboard
=SUMPRODUCT((J2:J2000=N2)*(G2:G2000<>"")/COUNTIF(G2:G2000,G2:G2000&""))