[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 285

# trying to extract a text string from a given area in a cell

I am trying to extract a text string in a cell within a givien set of characters. I have enclosed an example. text-extract-spread.xlsx
0
wagamama123
1 Solution

Microsoft MVP ExcelCommented:
try this

=LEFT(MID(A5,FIND("(",A5,FIND("(",A5)+1)+1,99),FIND("-",MID(A5,FIND("(",A5,FIND("(",A5)+1)+1,99),2)-1)+0
0

Chief EngineerCommented:
Try this.  It's kind of a monster but I think it works.

=MID(A1,FIND("**",SUBSTITUTE(A1,"(","**",2))+1,FIND("**",SUBSTITUTE(A1,"-","**",LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))))-FIND("**",SUBSTITUTE(A1,"(","**",2))-1)

Kyle
0

Commented:
Here is one way of approaching this
``````=MID(A1,FIND("(",A1,FIND("(",A1,1)+1)+1,FIND("-",A1,FIND("(",A1,FIND("(",A1,1)+1)+2)-FIND("(",A1,FIND("(",A1,1)+1)-1)
``````
0

Commented:
If the last number is always 3 digits as per your example, 110, 114 etc. then this should work

=LOOKUP(10^5,RIGHT(LEFT(A1,LEN(A1)-6),{1,2,3,4,5})+0)

regards, barry
0

Author Commented:
thank you!
0

Chief EngineerCommented:
Was there something in your data set that caused mine to work where teylyn's, reitzen's, and Barry's didn't?
0

## Featured Post

Tackle projects and never again get stuck behind a technical roadblock.