Thread: Att: RagDyeR
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
RagDyeR RagDyeR is offline
external usenet poster
 
Posts: 3,572
Default RagDyeR

The Find() function returns a number for the location of the character(s)
we're looking for.
In this case, it's the comma.
If that character is not found, Find() returns an error (#VALUE!).

Isnumber() evaluates the return of the Find() function ...
TRUE if it's a number (character found),
FALSE if it's an error (character *not* found).

SO, the return of Isnumber() designates which argument of that final IF()
formula will fire ...
the value-if-true, the text ", activated" ...
or, the value-if-false, a blank ( "" ).

Finally, try out this shorter version of the parsing formula.
It should do the same job as the original:

=MID(A1,SEARCH(") for",A1)+6,(FIND("(h)",A1)+2)-(SEARCH(") for",A1)+5))
&IF(ISNUMBER(FIND(",",A1)),", activated","")

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Hankjam" ........ wrote in message
...
On Sat, 27 Sep 2008 17:22:37 -0700, "Ragdyer"
wrote:

I see only one comma when "activated" is present.

Does this work for you:


=TRIM(MID(SUBSTITUTE(A1,"for","^^",2),FIND("^^",S UBSTITUTE(A1,"for","^^",2)

)
+3,


FIND("(h)",A1)-FIND("^^",SUBSTITUTE(A1,"for","^^",2)))&IF(ISNUMBE R(FIND(","

,
A1))," activated",""))

Hi

It surely did.

I've figured out how most of this works.

Could you explain the use of ISNUMBER?

Many thanks again

Aj