change e2 to =LEFT(D2,3)+0
then you will have real numbers
then use
=IFERROR(MATCH(E2,{0,501,502},0)-1,"")
or
leave it as it is
and use
=IFERROR(MATCH(E2,{"0","501","502"},0)-1,"")