View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Extracting A Portion Of A String

=MID(A3,FIND(",",A3,FIND(",",A3)+1)+1,2)

--
Regards,
Tom Ogilvy


"MWS" wrote in message
...
Hello, Can anyone assist me with a formula to extract 2 characters out of

a
string of text? For instance, the syntax of the string is:
Street Address(comma)City(comma)State(comma)Zip Code

What I need to extract are the 2 State characters.

Initially, I thought I could approach it from the righthand side of the
string, but then realized there was no consistency in the Zip Code format

(ie
sometimes it wasn't included, sometimes it was 5 characters, sometimes it

was
10 characters with hyphen, etc).

There is a consistent syntax that after the second comma, the next two
characters are for the state, but I'm having difficulty writing the

formula
to identify those two characters.

Any and All Help is Appreciated - Thank You