TraderDavis
New Member
- Joined
- Feb 12, 2015
- Messages
- 4
I have a list of URLs that I need to sift through, such as:
facebook.com
home.facebook.com
live.fanfooty.com.au
fanfooty.com.au
desktop.spotify.com
zlink.app.spotify.com
I only need the main part of the domain (facebook.com, spotify.com, fanfooty.com.au), and there are many different variations of these duplicates. I've been trying to figure out a conditional format that will highlight the duplicate cells containing the main part (so it should highlight "home.facebook.com" and not "facebook.com"), but I think it may not be possible. I only need to highlight the cells so I can deal with them on a case-by-case basis. Perhaps this can be done in VBA?
This is as far as I got with the conditional format... it doesn't work of course.
facebook.com
home.facebook.com
live.fanfooty.com.au
fanfooty.com.au
desktop.spotify.com
zlink.app.spotify.com
I only need the main part of the domain (facebook.com, spotify.com, fanfooty.com.au), and there are many different variations of these duplicates. I've been trying to figure out a conditional format that will highlight the duplicate cells containing the main part (so it should highlight "home.facebook.com" and not "facebook.com"), but I think it may not be possible. I only need to highlight the cells so I can deal with them on a case-by-case basis. Perhaps this can be done in VBA?
This is as far as I got with the conditional format... it doesn't work of course.
Code:
=AND(LEN($A10)-LEN(SUBSTITUTE($A10,".",""))>=2,OR(ISERROR(SEARCH(".com.",$A10)),ISERROR(SEARCH(".co.",$A10))),NOT(ISERROR(MATCH(MID($A10,FIND("@",SUBSTITUTE(A10,".","@",LEN(A10)-(LEN(SUBSTITUTE(A10,".",""))+1)))+1,(FIND("@",SUBSTITUTE(A10,".","@",LEN(A10)-LEN(SUBSTITUTE(A10,".",""))))+1-FIND("@",SUBSTITUTE(A10,".","@",LEN(A10)-(LEN(SUBSTITUTE(A10,".",""))+1)))-1)),A:A)))