Learn how to extract a domain from a URL using this simple Google Sheets formula. (It also works with Excel)
If you do SEO, at some point you are going to have to wrangle some URLs to get what you need. And if you are anything like me, these URLs are probably going to be in a spreadsheet.
Working with a list of backlinks in a sheet happens daily for me. Sometimes it is useful to extract domains from the URLs to make data easier to read, organise your data into top domains or just to tidy up your work.
With Google Sheets, this is very easy to do:
How to extract domain from URL
If you want to extract the domain name from a URL, you can use a formula that uses the LEFT and FIND functions.
Hereβs how to get the domain name from a URL:
Formula to get domain name from URL
When it comes to URL extraction, youβve got two options for how you want the output:
WITH trailing slash:
=LEFT(A2,FIND("/",A2,9))
WITHOUT trailing slash:
=LEFT(A2,FIND("/",A2,9)-1)
*in these formulas, the URL you want to wrangle is in cell A2 π
Before you go…
… you are not going to believe this but I actually have a Google Sheets Cheat Sheet for Marketers for sale.
It’s got 47 useful formulas and stuff in it if you like that kinda thing.
Want a discount code?
Here’s a clue:
I hide in plain sight,
Invisible to your eyes, yet bold in my might.
Search engines may find me, but readers cannot,
What am I, this sneaky SEO plot?
Voucher: here you go, you dirty little black hat SEO you: SUPER-SECRET-CODE