Extracting URLs domain name from various URL domain combos

thp510

Board Regular
Joined
Oct 19, 2015
Messages
110
Office Version
  1. 365
Platform
  1. Windows
I have various lists of website URLs in all shapes and sizes and I want to just have each website to be in this format: www.[insert your domain name].com Examples:

Column A
www.normals.com (pretty straight and fwd. About 80% of my list is like this and I don't need to change this)
https://www.securityreview.com (there's an http in front of the www and also there's an S in http)
http://raodstop.com/ (there's an http in front and there's no www)
www.raodstop.com/p/gda/31/ext (there's a lot of text in this URL after the .com portion)
truradio.de (there's no http or www for this URL. Plus I'd like to keep the full domain on this so it's www.truradio.de and NOT www.trueradio.de.com)


Does anyone have a formula that I can use to trim down column A and add www. AND also add .com to all of them?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
this works for your sample data

=IFERROR(LEFT(A1,FIND(".com",A1)+3),"www."&A1)
 
Upvote 0
Hi, here's another take..:


Excel 2013/2016
AB
1www.normals.comwww.normals.com
2https://www.securityreview.comwww.securityreview.com
3http://raodstop.com/www.raodstop.com
4www.raodstop.com/p/gda/31/extwww.raodstop.com
5truradio.dewww.truradio.de
Sheet1
Cell Formulas
RangeFormula
B1="www."&TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"www.","",1),"http://","",1),"https://","",1),"/",REPT(" ",255)),255))
 
Upvote 0
This is amazing! Thank you so much. It worked!!!!


Hi, here's another take..:

Excel 2013/2016
AB
1www.normals.comwww.normals.com
2https://www.securityreview.comwww.securityreview.com
3http://raodstop.com/www.raodstop.com
4www.raodstop.com/p/gda/31/extwww.raodstop.com
5truradio.dewww.truradio.de

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1="www."&TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"www.","",1),"http://","",1),"https://","",1),"/",REPT(" ",255)),255))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,561
Messages
6,125,538
Members
449,236
Latest member
Afua

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