Formula to Get a Domain Name from a URL in Libreoffice, Excel, and Google Sheets (With Generator!)

Enter the cell that contains your URL and the formula to get the domain name will be generated below.


=IF(ISNUMBER(FIND("/", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({{cellValue}}, "www.", ""), "http://", ""),"https://", ""), 3)), LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({{cellValue}}, "www.", ""), "http://", ""),"https://", ""), FIND("/", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({{cellValue}}, "www.", ""), "http://", ""),"https://", ""), 3) - 1), SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({{cellValue}}, "www.", ""), "http://", ""),"https://", ""))

About this formula: I used Lisp to help create it.

Leave a comment