R
Rick Rothstein \(MVP - VB\)
Harlan Grove said:...
...
Variation on this theme, define a name like NCHARS referring to, say,
255, and a name like seq referring to the formula
=ROW(INDEX($1:$65536,1,1):INDEX($1:$65536,NCHARS,1))
then use a formula like
=LOOKUP(1,-MID(A1,seq,1),MID(A1,1,seq))
This assumes the numeric substring is always at the beginning of the
string. If it could be in the middle or at the end of the string,
you'd need to use something like
=MID(LOOKUP(1,-MID(E6,seq,1),MID(E6,1,seq)),
MIN(FIND({0;1;2;3;4;5;6;7;8;9},E6&"0123456789")),NCHARS)
Yes, that definitely makes the formula look less intimidating; but then it
might require the inclusion of a mini-lesson on naming in case the poster is
unfamiliar with how to do that. The formula, as posted, of course, requires
nothing extra of the poster other than a simple copy/paste operation.
Just out of curiosity, if you know, is there any speed (efficiency)
advantage to using your suggested name references over using the
include-it-all method I posted? My guess is the answer is "yes" for the
'seq' name as it is repeated twice and probably "no" for the NCHARS name.
Rick