Microsoft Excel - Find word between 2 specified characters

Asked By reggie jack on 13-May-16 12:41 PM

Im looking for a  function to help me  look into a cell and locate a word between two characters
A1" "http://www.tcs.ca/crs/help/holidays.jsf" or www.tca/crs/default.jsf?LOCALE=fr
  1. Find ".jsf"
  2. Take all the characters up until the "/"
  3. To get "holidays"
i ave 5 diff  extension ".apx"  "/" and combination  to look for 
fr right, "jsp" to "/"  i.e:/rr/sarp.jsp/gg =sarp
Harry Boughen replied to reggie jack on 14-May-16 12:44 AM
Hello reggie jack,

This might do what you want without having to worry about the different file indicators.  It works on the '/' and the '.' instead.

=LEFT(TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99)),FIND(".",TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99)))-1)

Regards

Harry
Harry Boughen replied to reggie jack on 14-May-16 08:04 AM
Hello again reggie jack,

Here is another version that is a little more compact.

=TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99)),".",REPT(" ",99)),99))

As before this assumes that your URL is located in cell A1.

Regards

Harry
reggie jack replied to Harry Boughen on 06-Jun-16 03:55 PM
A++++
this is awesome.

Thank you very much.
Harry Boughen replied to reggie jack on 06-Jun-16 05:19 PM
You're welcome reggie jack.
Harry