View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Remove text from cell

On Fri, 7 Apr 2006 01:41:01 -0700, ThomasVike
wrote:

In a cell there is text and numbers, example: ABC123. In an other cell I want
to show the numbers only (123).

I can't find a useful function, any suggestions?


If there is only a single string of digits, as in your example, then Bob's
formula will work fine.

If you have multiple digit strings, as in ab123cd456, then one solution would
be to download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr

and use the regular expression formula:

=REGEX.SUBSTITUTE(A1,"\D")

This returns the digits as a text string, so if you need it as a numeric value,
precede the above with a double unary to convert it.

=--REGEX.SUBSTITUTE(A1,"\D")


--ron