There are lots of different cases that you need to work through. Here is the complete formula that worked for us:
SUBSTITUTE(
IF(
FIND(
"/",
IF(
FIND("www.", Website) > 0,
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//www.", Website) + 5), NULL),
Website
),
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//", Website) + 1), NULL),
Website
)
)
) > 0,
LEFT(
IF(
FIND("www.", Website) > 0,
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//www.",Website) + 5), NULL),
Website
),
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//",Website) + 1), NULL),
Website
)
),
FIND(
"/",
IF(
FIND("www.", Website) > 0,
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//www.",Website) + 5), NULL),
Website
),
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//", Website) + 1), NULL),
Website
)
)
) - 1
),
IF(
FIND("www.", Website) > 0,
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//www.", Website) + 5), NULL),
Website
),
IF(
FIND("//", Website) > 0,
SUBSTITUTE(Website, LEFT(Website, FIND("//", Website) + 1), NULL),
Website
)
)
),
'www.',
''
)