View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Use FIND for / or \ or -

Why not just pick one of the search characters and then do only two
substitutions (one for each of the other characters)...

=LEFT(A1,FIND("\",SUBSTITUTE(SUBSTITUTE(A1,"/","\"),"-","\"))-1)

Rick


"Teethless mama" wrote in message
...
Another way...

=LEFT(A1,FIND("^",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (A1,"\","^"),"/","^"),"-","^"))-1)


"Bert" wrote:

appy New Year all,
I want to use the FIND function with LEFT to extract the numbers left of
a
marker which could be / or \ or -
I can only see how to use FIND for one character how to use for multiple
possibilites? (so when FIND reaches / or \ or - it returns the position)
Thanks for any suggestions
Bert