Created
August 18, 2016 21:59
-
-
Save ciaranmahoney/046a6c1cfd9e12eb37a9adea34a5e7df to your computer and use it in GitHub Desktop.
Formula for extracting naked domain from full url in Google Sheets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=iferror(trim(REGEXEXTRACT(REGEXREPLACE(REGEXREPLACE(A2,"https?://",""),"^(w{3}\.)?","")&"/","([^/?]+)"))) |
I was able to get a formula of my own that works with subdomains as well. I have written about it here universal URL to domain google sheets.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for the formula. how would you extract subdomains e.g. "sub.example.com" to "example.com"?