I have a bunch of web sites in a list, with junk characters after the .com/.org, etc. I need to remove all characters after the .com/.org, but keep the .com/.org. For example:

these
sitename.com - platypus
websiteplace.com - gargoyle

become
sitename.com
websiteplace.com

I've searched around a bunch and can't find something that works quite that way.

Thanks in advance.

  • 1
    Try this formula: =LEFT(A1;FIND(".";A1&".")+3) , A1 beeing your "sitename.com - platypus " cell. – User552853 Apr 18 at 5:16
  • 1
    Remove everything after (and including) the first space encountered in the string. – Art Gertner Apr 18 at 7:34

Suppose your data are in column A, then in the adjacent cell, write this formula:

=LEFT(A2,FIND("-",A2)-2)

Check the screenshot below:

enter image description here

  • Awesome, thanks! I ended up using a variant of this. Like this: =LEFT(D2,FIND(".com",D2)+3) Do you know if it's possible to 'nest' finds in that, so for example have that one formula do the same thing but also find .org, .net, .info, etc? – Klarg Apr 18 at 21:42
  • @Klarg you can use array constants. Don't forget you'll also need to check the length of the found domain. – Ron Rosenfeld Apr 19 at 1:46

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.