Find and extract text from cell
Many thanks to you both.
--
David P.
"Ron Rosenfeld" wrote:
On Tue, 16 Sep 2008 04:23:54 -0400, "Rick Rothstein"
wrote:
A little shorter and normally entered....
=MID(LEFT(A1,FIND(",",A1&",")-1),MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789") ),255)
although it differs from yours at the extremes... if there is no number in
the text, my formula returns an empty string whereas yours returns an #N/A
error... if there is no comma in the text, my formula returns from the first
number to the end of the text whereas yours returns a #VALUE! error. These
differences may or may not be significant to the OP.
The REGEX formulas I posted likewise return empty strings if the pattern
doesn't match.
The issue, of course, arises if the specification the OP posted turns out not
to be 100% accurate. For me, the regex expressions will be easier to change
and test.
--ron
|