Thread: Search
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Search

The numerical part is always 7 characters long

Try this...

=LOOKUP(1E100,--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"01234567 89")),7))

Note that this formula will strip off any leading 0s from the number string.
Excel doesn't recognize leading 0s as part of a *numeric number*. If there
might be leading 0s you can either use a different formula to extract the
string as a TEXT value and retain any leading 0s or you can use the above
formula which extracts the string as a NUMERIC NUMBER and then apply a
custom number format to display any leading 0s.

--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
OK,
Ex.1 qwertyabc1234567
Ex.2 poi4567365fgher
Ex.3 6945908FGTEy

I would like to be able to extract just the numerical characters from each
cell.
The numerical part is always 7 characters long, but I don't know where it
begins in the string, or how many non-numerical characters there may be.
So I want to search for the first number (SEARCH(CODE(48 to 57), then use
that as the starting point for the MID() function, which can extract the 7
digit number if it knows where to start.
Sorry I was vague before. Hope this is better.
Regards - Dave.

"T. Valko" wrote:

SEARCH will return the starting position number of the search criteria.
Is
that what you want?

How about posting several representative samples of your data so we can
what
you're trying to do.

--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
Is it possible to use the Search (or Find) function to find a number in
a
text string?
eg SEARCH(CODE(<57),A1)
This doesn't work, but hopefully it gives an idea of what I'm after.
Ideally, I'd like:
SEARCH(CODE(48 to 57),A1)
Possible?
Regards - Dave.



.