How to strip out domain from cell in excel

I use this formula all the time when I have a list of page URL’s when I only want the domain name.

=LEFT(A1,FIND(“/”,A1,9))

If you want the domain without the trailing slash its:

=LEFT(A1,FIND(“/”,A1,9)-1)

If you want just x.co.uk:

=IF(ISNUMBER(FIND(“www.”,A2)),MID(A2,FIND(“www.”,A2)+4,IF(ISNUMBER(FIND(“/”,A2,9)),FIND(“/”,A2,9),LEN(A2)+1)-FIND(“www.”,A2)-4),MID(A2,FIND(“//”,A2)+2,IF(ISNUMBER(FIND(“/”,A2,9)),FIND(“/”,A2,9),LEN(A2)+1)-FIND(“//”,A2)-2))

Enjoy.