If it is always the third # that is preceding the email and there is always
a # |\ at the end this will work
=LEFT(RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"#","^^",LEN(A1)-LEN(SUBSTI
TUTE(A1,"#",""))-1))),FIND("#",RIGHT(A1,LEN(A1)-SEARCH("^^",SUBSTITUTE(A1,"#
","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"#",""))-1))))-1)
of course there can't be any ^^ in the strings
...
Your formula assumes the e-mail address lies between the penultimate and final
"#" in the string rather than after the 3rd one, and it doesn't depend on the
ending characters other than the existence of a "#" after the e-mail address.
If there could be a ^^ in the string, then one alternative would be defining a
name like Seq referring to =ROW(INDIRECT("1:1024")) and using the array formula
=MID(A1&"#",SMALL(IF(MID(A1,Seq,1)="#",Seq),3)+1,
SMALL(IF(MID(A1&"#",Seq,1)="#",Seq),4)-SMALL(IF(MID(A1,Seq,1)="#",Seq),3)-1)
This generalizes more easily for an arbitrary field seperator string, SEP, as
=MID(A1&SEP,SMALL(IF(MID(A1,Seq,1)=SEP,Seq),3)+LEN(SEP),
SMALL(IF(MID(A1&SEP,Seq,1)=SEP,Seq),4)-SMALL(IF(MID(A1,Seq,1)=SEP,Seq),3)
-LEN(SEP))