Thread: Find Function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
papou
 
Posts: n/a
Default Find Function

Hello
Here is a try not too far from what you're after :
=IF(A1="";"";IF(ISERROR(FIND("
";A1;1));IF(OR(LEFT(A1;2)="Ch";LEFT(A1;2)="Sh");PR OPER(LEFT(A1;2))&".";LEFT(A1;1)&".");IF(OR(LEFT(A1 ;2)="Ch";LEFT(A1;2)="Sh");PROPER(LEFT(A1;2))&"."&P ROPER(MID(A1;FIND("
";A1;1)+1;2))&".";LEFT(A1;1)&"."&IF(OR(MID(A1;FIND ("
";A1;1)+1;2)="Ch";MID(A1;FIND(" ";A1;1)+1;2)="Sh");PROPER(MID(A1;FIND("
";A1;1)+1;2))&".";MID(A1;FIND(" ";A1;1)+1;1)&"."))))
The only remaining problem it seems, resides in data like "Charlie Ben"
where my function will return "Ch. Be."

HTH
Cordially
Pascal

"Guy Lydig" a écrit dans le message de
news: ...
Is there a limit to the number of times the Find function can be used in
one
formula? (I know you can nest only up to 7 If functions. Does Find have
such
a limitation?)

Okay gurus, I've been breaking my head and I've almost got this licked,
(except for the aforementioned problem with Find...) but I'm wondering if
there isn't a much easier way to do this:

Column B (First Name) has some cells that have:
nothing at all (empty cells)
one initial with a period
two initials with periods and a space between
one name
two names
one name and one initial

Problem:
In column C, I would like to extract just the initials--with one little
catch: if either the first or second name begins with either Ch or Sh, the
initial should be both those letters. Here's what I want:

Column B Column C

S. C. S. C.
Charles Ch.
Sharlene Sh.
Ben B.
Ben Charles B. Ch.
Sharlene Charley Sh. Ch.
Ben James B. J.
Charlie Ben Ch. B.
D. D.

My function is replete with If, And, Or, Find, Isblank, Iserror, Left,
and
Mid: a total of close to 400 characters...AND--it still doesn't work
because
it is complaining about a Find function.

Anyone have any simpler ideas?

TIA

Guy