Try this array formula

=MIN(IF((J$2:J$10=2)*(G$2:G$10=G2)*(P$2:P$10<>0),P$2:P$10))