View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Use InStr function in formula?

Dave Peterson wrote...
One way:

=LOOKUP(2,1/(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)="e"),
ROW(INDIRECT("1:"&LEN(A1))))

....

That's specific to the sought text being a single character rather than
a possibly variable length substring. Alternatives include

=FIND(CHAR(127),SUBSTITUTE(A1,A2,CHAR(127),
(LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")))/LEN(A2)))

and

=LOOKUP(33000,FIND(A2,A1,ROW(INDEX(1:65536,1,1):IN DEX(1:65536,LEN(A1),1))))

where A1 is the string to be searched and A2 is the substring sought.