extrating data from a string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I have a string:

"New York City"
how do I extract only the middle word (York)?

thanks in advance
 
In this particular instance, this works
=MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1)
but it wouldn't work for 99% of other city names.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
If I have a string:

"New York City"
how do I extract only the middle word (York)?

thanks in advance

What kind of solution do you want.

Bob gave you a solution for three word strings.

But do you need something more general?

What do you want to happen if there are only two words; or if there are six or
seven words?


--ron
 
Back
Top