Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove www. from domains in excel

Ive got a list of urls in column A, some of them have www. some dont, (none of them have http:// in this example)

What im trying to do is strip the www. do ive got a list of domains that i can order alphabeticly. I was looking at using =RIGHT(A1, LEN(A1)-4) but not all the domains have www. Any idea how you would be able to do this using a formula, rather than VBA so that it can run in both excel and Google Drive ?


EDIT

Ive now updated the example spreadsheet with Alex Szabó's answer - https://docs.google.com/spreadsheets/d/1x-zjaIh7xpGeyWPbYLAn5RyNjbrDWFQdI_U5WmS3fys/edit#gid=0

like image 963
sam Avatar asked Mar 17 '23 12:03

sam


1 Answers

You could check for the "www" in the beginning, and if it's there, then strip it by using all letters from the address, except the first 4.

=IF(LEFT(A2,4)="www.", RIGHT(A2, LEN(A2)-4), A2)
like image 62
Alex Szabo Avatar answered Mar 24 '23 18:03

Alex Szabo