Extracting a SKU from a URL

laurigardner

New Member
Joined
Aug 11, 2018
Messages
3
Hi,

I have the following example URLs:
https://viyet.com/andrianna-shamaris-teak-and-bone-inlay-circular-bookcase-sto-49740-27277.html
https://viyet.com/janus-et-cie-large-shell-bowl-acc-49959-2600.html
https://viyet.com/jonathan-adler-danner-loveseat-sea-45150-33425.html

The length is variable from the left, but from the right it isn't.



What I need to do is extract from the 3rd "-" with a trim of .html So it looks like this:
sto-49740-27277
acc-49959-2600
sea-45150-33425

I keep trying to figure out how to do this with MID, RIGHT and SEARCH, but it's not coming together.

Any help would be greatly appreciated!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Apologies. I can't seem to edit the original message, and I hadn't noticed that it trunkates the links. Here's the links as text:

Code:
https://viyet.com/andrianna-shamaris-teak-and-bone-inlay-circular-bookcase-sto-49740-27277.html
https://viyet.com/janus-et-cie-large-shell-bowl-acc-49959-2600.html
https://viyet.com/jonathan-adler-danner-loveseat-sea-45150-33425.html
 
Upvote 0
Hi,

Assuming your data starts at A1 down, formula in B1 copied down:


Book1
AB
1https://viyet.com/andrianna-shamaris-teak-and-bone-inlay-circular-bookcase-sto-49740-27277.htmlsto-49740-27277
2https://viyet.com/janus-et-cie-large-shell-bowl-acc-49959-2600.htmlacc-49959-2600
3https://viyet.com/jonathan-adler-danner-loveseat-sea-45150-33425.htmlsea-45150-33425
Sheet324
Cell Formulas
RangeFormula
B1=SUBSTITUTE(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",100)),300))," ","-"),".html","")
 
Upvote 0
This is probably too risky to rely on but it does work for the samples given.

Excel Workbook
AB
1https://viyet.com/andrianna-shamaris-teak-and-bone-inlay-circular-bookcase-sto-49740-27277.htmlsto-49740-27277
2https://viyet.com/janus-et-cie-large-shell-bowl-acc-49959-2600.htmlacc-49959-2600
3https://viyet.com/jonathan-adler-danner-loveseat-sea-45150-33425.htmlsea-45150-33425
Extract
 
Upvote 0

Forum statistics

Threads
1,214,613
Messages
6,120,515
Members
448,968
Latest member
Ajax40

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