Splitting a Text String Starting at a Specific Character

RMcCreavy
Lounger
Posts: 39
Joined: 02 Nov 2018, 16:12

Splitting a Text String Starting at a Specific Character

Post by RMcCreavy »

Hello,

I'm having trouble combining Find/Search with text formulas in excel to retrieve everything after the final "/" within a URL,

Lookng for something similar to "=RIGHT(B5,LEN(B5)-FIND("_",B5))" from the link below:

https://exceljet.net/formula/split-text ... -character

In my case, the URLs are not uniform, and I have not been able to retrieve the desired text string regardless.

ex:

For "Operations/wayne/race/Shared Documents/DTC-Performance/CAR Report 6-29-18.xlsx" in cell A1
I want a formula to retrieve "CAR Report 6-29-18.xlsx" or some equivalent file name, regardless of how many "/"s there happen to be within the URL.

Thanks in advance!

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Splitting a Text String Starting at a Specific Character

Post by Doc.AElstein »

Hi
I found this
https://www.exceltip.com/excel-text-for ... -path.html" onclick="window.open(this.href);return false;
=TRIM(RIGHT(SUBSTITUTE(A1,""/"",REPT("" "",100)),100))

This bit puts lots of spaces ( 100 ) in place of all the /s
=SUBSTITUTE(A1,""/"",REPT("" "",100))

Then this just catches the last bit which looks like CAR Report 6-29-18.xlsx with lots ( approx 80 ) of spaces in front of it,
=RIGHT(SUBSTITUTE(A1,""/"",REPT("" "",100)),100)

Then finally the Trim takes off all the spaces

Alan
Last edited by Doc.AElstein on 29 Nov 2018, 19:45, edited 3 times in total.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

Toranaga
3StarLounger
Posts: 254
Joined: 15 Aug 2016, 11:23

Re: Splitting a Text String Starting at a Specific Character

Post by Toranaga »

Hi,

Try:

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

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Splitting a Text String Starting at a Specific Character

Post by Doc.AElstein »

SNAP
I said snap first so do I get all the points ? :)
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

Toranaga
3StarLounger
Posts: 254
Joined: 15 Aug 2016, 11:23

Re: Splitting a Text String Starting at a Specific Character

Post by Toranaga »

:laugh:

Why you put double quotes instead of normal quotes ??
=TRIM(RIGHT(SUBSTITUTE(A1,""/"",REPT("" "",100)),100))

This bit puts lots of spaces ( 100 ) in place of all the /s
=SUBSTITUTE(A1,""/"",REPT("" "",100))

Then this just catches the last bit which looks like CAR Report 6-29-18.xlsx with lots ( approx 80 ) of spaces in front of it,
=RIGHT(SUBSTITUTE(A1,""/"",REPT("" "",100)),100)

RMcCreavy
Lounger
Posts: 39
Joined: 02 Nov 2018, 16:12

Re: Splitting a Text String Starting at a Specific Character

Post by RMcCreavy »

Thanks, guys! Cheers :cheers:

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Splitting a Text String Starting at a Specific Character

Post by Doc.AElstein »

Toranaga wrote::laugh:
Why you put double quotes instead of normal quotes ??
oops, I always put the formulas in with code 'cos then it take the English formula and put it in German correct in my German Excel, so I need the double quotes there in the code, and like a Tw*t I copied from the VB editor.... sorry ...._
_.....Oh Poo, now I get no points or :chocciebar: :sad:
_.___-
@ RMcCreavy .. you need to change those double quotes to single ones, but I guess you noticed that
:)

Alan
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also