View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Return position of 2nd, 3rd, ect occurrence of a character in a st

Hi!

Try this:

=FIND("~",SUBSTITUTE(A1,"x","~",B1))

Searching for "x". B1 holds the instance you want.

Note: Substitute is case sensitive. To make it a little more robust:

=FIND("~",SUBSTITUTE(UPPER(A1),"X","~",B1))

"~" is used as a "marker". The marker needs to be some char or group of
chars that are more than likely not to appear in the string.

Biff

"jheby" wrote in message
...
the Excel =FIND command returns the position of the first instance of a
string that it finds. Is there any way to find position of the 2nd, 3rd,
or
nth occurrence? Using =MID is too messy.