Do you have several 2-letter codes? If so, then you can use VLOOKUP, making use of a table of those codes and meanings (username/password) elsewhere on the sheet. Suppose you put that table in columns X and Y, and the cell that you want to test is A4 - then you can use this formula in B4:

=IFERROR(VLOOKUP(LEFT(A2,2),$X:$Y,2,0),"not found")

then copy down as required.

Hope this helps.

Pete