2 min read

How to extract domains from URLs in Excel

In the day to day of an SEO, it’s inevitable you’ll need to manipulate URLs to get what you need. Working with a large number of backlinks is a common occurrence and you may need to extract domains from the URLs to make data more digestible. Luckily this is very easy to do in Excel, read ahead to find out how!

In our worked example, we have pulled backlink data from Ahrefs for a popular website. As there are thousands of individual links, we want to quickly simplify the data and break down to domain level.

Now here’s the bit you care about…

I’m going to share with you two fast and easy methods to extract domains from URLs in Excel. Though you should definitely use method 2… (skip to method 2)

Method 1: Formula

1) Insert two new columns at the front of your data, so columns A and B are empty.

2) Copy and paste your backlinks into column A (steps 1 & 2 means you don’t have to tweak the formula), then add a heading ‘Domains’ in B1.

3) Enter the formula below into cell B2

=IF(ISERROR(FIND("//www.",A2)), MID(A2,FIND(":",A2,4)+3,FIND("/",A2,9)-FIND(":",A2,4)-3), MID(A2,FIND(":",A2,4)+7,FIND("/",A2,9)-FIND(":",A2,4)-7))

formula to extract domain from url

4) Copy and paste this down / Fill handle (this formula will extract the domain from URLs for all scenarios e.g. ‘http’, https’ or ‘www.’)

5) Copy and paste values to remove formula

fill handling formula to get domains from URLs

And there you have it! You will now have a clean column of domains.

Method 2: Find & Replace Wildcard*

(my favourite method)

Using a wildcard in conjunction with Find & Replace is a gamechanger! With just a couple of quick replaces, your URLs will be tidied, without needing to remember or dig out a dirty long formula like the above.

1) Add a second column next to your backlink data and copy and paste the first column into second so you’ve got two identical columns.

duplicate column preparation for extracting domains from URLs

2) Highlight the second column, then press CTRL + F (Windows) or CMD + F (Mac), then click ‘Replace…’

Here’s the trial and error part, you’ll want to first remove the protocol at the front of the URL, and then the path after the domain. The following steps will clear up every possible URL scenario in 3 simple steps.

3) Here’s the trial and error part, you’ll want to first remove the protocol at the front of the URL, and then the path after the domain. The following steps will clear up every possible URL scenario in 3 simple steps:

1) *www.

2) *://

3) /*

find and replace to extract domains from urls in excel

Done! You’ve successfully extracted domains from your list of URLs. Simple right?

Should you want to get really crafty, check out our article on how to extract domains using python for a clear and easy guide.

Want to learn more? Keep an eye on our blog as we’ll be sharing more helpful Excel tips or follow us on Twitter.

Explore Our Services

DIGITAL PR 

Earn authoritative links and drive brand awareness with Digital PR

PAID SEARCH

Deliver instant traffic and revenue through Paid Search and Shopping

SOCIAL ADS

Reach new audiences and retarget existing ones on social channels 

CONTENT

Attract and engage website visitors with a well executed content strategy

Harnessing High Search Volume Keywords for Maximum Impact

5 min read

Harnessing High Search Volume Keywords for Maximum Impact

Discover the power of high search volume keywords and how to effectively use them to boost your online presence and drive maximum impact.

Read More
Honcho partner with Eflorist to support Digital PR campaigns across Europe

2 min read

Honcho partner with Eflorist to support Digital PR campaigns across Europe

We're delighted to officially announce our partnership with Eflorist, one of the world’s leading flower delivery brands with over 54,000 local flower...

Read More
Driving Digital PR in Automotive: How to Win

5 min read

Driving Digital PR in Automotive: How to Win

Working agency-side in digital marketing often means that you’re expected to be a jack of all trades, with industry expertise stretching across...

Read More

How to get root domain from URL using Python

As SEO professionals, a lot of the work we do involves analysing and manipulating URL data. While URL data is great, when it comes to digesting that...

Read More

March Search Updates 2021

Google may see web pages as duplicates if URLs are too similar During the Google Search Central SEO hangout recorded on March 5, the topic of Google...

Read More

1 min read

Google Adwords Basic's Blog: Display URL’s

Welcome to the latest edition of the Google Adwords Basics Blog. In this blog I will express the importance of using targeted display URL’s. Display...

Read More