Thread: Mid,Find,Len
View Single Post
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Rachel

there might be an easier way but this seems to work for me

=MID(A1,SEARCH("_",A1)+1,LEN(A1)-(SEARCH("_",A1)+1)-(LEN(A1)-SEARCH("_",A1,SEARCH("_",A1)+1))-LEN(B1))

Cheers
JulieD

"Rachel" wrote in message
...
Hi
A1= abcd_XXXXXyyyyyyy_AB
B1 = yyyyyyy
I am trying to extract the XXXXX portion of A1 with this formula....

C1=MID(A1,FIND("_",A1)+1,FIND("_",A1,FIND("_",A1)+ 1)-FIND("_",A1)-1-LEN(B1))

Which works fine for this example however if len(b1) changes then the
result
changes in the same manner. What am I doing worng?
Thanks