Something like this should do the trick:
=IF(ISNUMBER(MATCH(Name,ListOfNames,0)),VLOOKUP(Name,ListOfNamesAndPassword,2,FALSE),"No Match")
Note that I'm assuming the passwords are in the 2nd column. If this is not the case, adjust the 3rd argument in the VLOOKUP function.