Search text string

gripper

Board Regular
Joined
Oct 29, 2002
Messages
176
Hi guys,

Hoping somebody can help. I have a multi-column worksheet and in column "B" I have long text strings within the several hundred rows in which I want to extract some data and place that extracted date in to column "H"

There is a consistent pattern with the start and end point.

The start point of the string is after "in " and the end point is a comma ",". I want what is in the middle which is either is 1-5 words.

Example: John Smith in Detroit, Michigan. In this case I would want "Detroit" copied to column "H"

These text strings are a bit longer then this and of different lengths so it needs to use these delimiters to mark the beginning and end of the data.

Any help would be greatly appreciated.

Thank you
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
=trim(right(substitute(left(a1,find(",",a1&",")-1)," ",rept(" ",255)),255))
 
Upvote 0
Or
=MID(B2,SEARCH("in ",B2)+3,SEARCH(",",B2)-(SEARCH("in ",B2)+3))
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top