View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernd P Bernd P is offline
external usenet poster
 
Posts: 806
Default Return first 2 numbers of a cell

Hello,

If you want to get a number, I suggest
=--Left(a1,2)
to extract a 2-digit number or, to be on the *very* safe side,
=--regexpreplace(A1,"^\D*(\d+).*$","$1")

The UDF regexpreplace you can find he
http://www.sulprobil.com/html/regexp.html

Regards,
Bernd