View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Extract value from a text string

Ok, just add your error trap to the beginning of the formula:

=IF(ISERROR(SEARCH("ABC",C19)),0,--TRIM(RIGHT(SUBSTITUTE(C19," ",REPT("
",255)),255)))

=IF(COUNT(SEARCH("ABC",C19)),--TRIM(RIGHT(SUBSTITUTE(C19," ",REPT("
",255)),255)),0)

=IF(COUNTIF(C19,"*ABC*"),--TRIM(RIGHT(SUBSTITUTE(C19," ",REPT("
",255)),255)),0)

--
Biff
Microsoft Excel MVP


"Dinesh" wrote in message
...
Hi,

Yes, the amount is always at the end. I have hundreds of text string. So I
want to extract only if the proceeds is related to"ABC". That is one
criteria
that I forgot to emphasis.

Thanks,
Dinesh

"T. Valko" wrote:

Since the number to extract seem to *always* be at the end of the string:

=--TRIM(RIGHT(SUBSTITUTE(C19," ",REPT(" ",255)),255))

--
Biff
Microsoft Excel MVP


"Dinesh" wrote in message
...
Hi,

I have three slightly three different text string where I want to
extract
a
proceed value (672707.58) from it. Below are the text strings.

1) XYZ Corp MLA 2799 SCH 053-000 ABC-72494 Proceeds to ABC for -
672707.58
2) XYZ Corp MLA 2799 SCH 053-000 ABC-72494 Proceeds to ABC Inc for
672707.58
3) XYZ Corp MLA 2799 SCH 053-000 ABC-72494 Proceeds to ABC Inc
672707.58

Below is a formual that works only on the first scenerio. For the
second
and
third text string, I get a "#value" error.

=IF(ISERROR(SEARCH("ABC",C19)),"0",MID(C19,SEARCH( "- ",C19)+1,99)+0)

Thanks,

Dinesh