Oops! some changes in formula is required:
Pls use:
=IF(IFERROR(IF(IFERROR(VLOOKUP(LEFT(B9,1),_S1,1,0),"")=LEFT(B9,1),VLOOKUP(MID(B9,2,LEN(B9))/1,_p1,1,0),IF(IFERROR(VLOOKUP(LEFT(B9,1),_s2,1,0),"")=LEFT(B9,1),VLOOKUP(MID(B9,2,LEN(B9))/1,_p2,1,0),NA())),"")="","",B9)