Didn't notice you had a mixture of numbers and alpha entries... that only works with one or the other....

try:

=IF(P10="","",IF(ISNA(VLOOKUP(P10,DATA!$C$6:$E$19,3,0)),IF(ISNA(VLOOKUP(P10,DATA!$F$6:$G$19,2,0)),"",VLOOKUP(P10,DATA!$F$6:$G$19,2,0)),VLOOKUP(P10,DATA!$C$6:$E$19,3,0)))
copied down.