HELP: on a string

gtben

New Member
Joined
Jan 15, 2014
Messages
6
Hi all,

how do i cut the last part from the url without "T-Shirt-#"

for example:

url/global/Holidays/Halloween/Frightening-Pumpkin-T-Shirt-1117/ -------------return Frightening-Pumpkin
url/Holidays/Christmas/Who-Needs-Santa-Ive-Got-Grandma-T-Shirt-7391/ --- return Who-Needs-Santa-Ive-Got-Grandma
url/Couples/Hes-My-King-T-Shirt-7375/ -------------------------------------return Hes-My-King

Thanks
for your kind help!
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi all,

how do i cut the last part from the url without "T-Shirt-#"

for example:

url/global/Holidays/Halloween/Frightening-Pumpkin-T-Shirt-1117/ -------------return Frightening-Pumpkin
url/Holidays/Christmas/Who-Needs-Santa-Ive-Got-Grandma-T-Shirt-7391/ --- return Who-Needs-Santa-Ive-Got-Grandma
url/Couples/Hes-My-King-T-Shirt-7375/ -------------------------------------return Hes-My-King

Thanks
for your kind help!
For the sample data you posted, this appears to work...

=TRIM(RIGHT(SUBSTITUTE(TRIM(LEFT(RIGHT(SUBSTITUTE("-T-Shirt-"&A1,"-T-Shirt-",REPT(" ",299)),598),299)),"/",REPT(" ",299)),299))
 
Upvote 0
Great!!! you are BEST!!
Thanks a lot!! :)
Assuming the text "-T-Shirt-" will only ever appear once in a given URL, here is a simpler formula that should also work for you...

=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,SEARCH("-T-Shirt-",A1)-1),"/",REPT(" ",299)),299))
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top