Formula to Extract Number Prior to .htm in URLs

powers17

New Member
Joined
Oct 7, 2013
Messages
2
Hi, I have a list of several hundred URLs that end with a product number. For example, they all end with /18442.htm. I need to pull out all the product numbers into a separate column using a formula. The product number is not necessary the only number in the URL string, but in most cases they are 5 characters long and always precede the .htm. Thanks for any help!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Excel Workbook
AB
1URLProd #
25021xyz/abc17345/18442.htm18442
Sheet5
 
Upvote 0
I know I am late to the party, but I think this slightly shorter formula will also work for you...

=SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",300)),300)),".htm","")
 
Upvote 0

Forum statistics

Threads
1,216,747
Messages
6,132,488
Members
449,730
Latest member
SeanHT

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