View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Lio Lio is offline
external usenet poster
 
Posts: 2
Default How to extract decimal numbers e.g. $1.57 from alphanumeric st

Hi Franz, Biff & Macropod!

Thank you very much to all three of you! I'm trying out getting help from
the community the very first time and I'm amazed by the speed and willingness
to help!!

Whilst Franz's solution is the most elegant to my given problem, in other
situations where the string structure is not constant (different decimal
places or missing currency sign $), Macropod's and Biff's respective
solutions work perfectly. Great job guys!!

Lionel

"Franz Verga" wrote:

Nel post
*Lio* ha scritto:

Hi!

Alphanumeric string: "Option Exercise at $22.09 per share."

How does one extract 22.09 from the above alphanumeric string?

I tried the array:
=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9), 1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))
But this only returns the first whole number.

Thanks.


If the string has always the same structure you could use this formula:

=VALUE(MID(B8,FIND("$",B8)+1,5))

where in B8 you have your string.

Then you have to format as Currency the cell with the formula.


--
(I'm not sure of names of menus, options and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy