Codes and IDs often pack several pieces of information into one text. Three functions get at them by position:
=LEFT(text, n) returns the first n characters: LEFT("NY-4471",2) is NY.
=RIGHT(text, n) returns the last n: RIGHT("NY-4471",4) is 4471.
=LEN(text) counts the characters, spaces included.
The results are text, even when they look like numbers. Wrap them in VALUE if you need to calculate with them.
LEN is the quickest way to spot hidden spaces: if "Lisbon" has a LEN of 7, there's an extra space somewhere. Combined with the others, it handles variable lengths: RIGHT(A2,LEN(A2)-3) drops the first three characters, whatever the length.