Please enable JavaScript to view the comments powered by Disqus.


MID(...IF(...ISNUMBER(...RIGHT(...A2,1)+0)=TRUE,RIGHT(...A2,8),""),1,2)

Find the two characters representing US City in a string

The formula examines the last digits that accompany the text string and then looks for the city code the precedes it. 


Used Functions

Category: Text

Returns a specific number of characters from a text string starting at the position you specify

Syntax

MID(text, start_num, num_chars)

Category: Logical

Specifies a logical test to perform

Syntax

IF(Something is True, then do something, otherwise do something else)

Category: Information

Returns TRUE if the value is a number

Syntax

ISNUMBER(value)

Lets chat on this