Extract Text from Middle of Cell Contents

clortan

New Member
Joined
Dec 20, 2012
Messages
15
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I need help extracting the bold text from the middle of these examples.

Text Text # 1 - Downtown Dallas - 15368 Product Description
Text Text Text # 2 - Northpark Center - 16485 Product Description

I am need the store name, which will always be after the # and space and all the information before the next - and space

Thank you !
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
With your text string in A1, try:
Code:
=MID(A1,FIND("#",A1)+2,FIND("-",A1,FIND("-",A1)+2)-FIND("#",A1)-2)
 
Upvote 0
Or this 1, slightly shorter...
=TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",50)),50,50))
 
Upvote 0
Hi Ron (my brother's name) and Ford (cute dog)

Thank you both! Here is what happened:

With =MID(A1,FIND("#",A1)+2,FIND("-",A1,FIND("-",A1)+2)-FIND("#",A1)-2)

There were varied blank spaces at the beginning and 1 at the end of the output.
___1 Downtown Dallas_
__30 King of Prussia_
_101 Austin_

With =TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",50)),50,50)) - This one almost works. There were no spaces, and if the # could go away at the beginning I would be great!!
#1 Downtown Dallas
#30 King of Prussia
#101 Austin
 
Upvote 0
Try surrounding the formula with TRIM, like this:
Code:
[COLOR=#333333]=TRIM(MID(A1,FIND("#",A1)+2,FIND("-",A1,FIND("-",A1)+2)-FIND("#",A1)-2))

[/COLOR]
If that doesn't solve it, please show us the original text strings.
 
Upvote 0
Change it to this instead...
=TRIM(MID(SUBSTITUTE(A1,"#",REPT(" ",50)),50,50))
 
Upvote 0

Forum statistics

Threads
1,203,693
Messages
6,056,760
Members
444,889
Latest member
ibbara

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