Remove everything to the right of a character
Hi, I've searched the forum, but can't seem to find a solution.
I have a series of domain names all different length. Some of them have subdomains, some don't. I need to automatically remove the subdomain text.
Examples:
Domain 1: thisisadomain.com/ = no issue
Domain 2: thisisanewdomain.com/en = I want to remove everything to the right of the /
Domain 3: thisisanotherdomain.com/products/en = I want to remove everything to the right of the first /
I should just end up with:
thisisadomain1.com/
thisisanewdomain.com/
thisisanotherdomain.com/
The issue is the different lengths of the domains before the / appears.
I have it in my head that I should use FIND to find the first / and then replace anything after that with "", but I don't know if that's the right way of thinking - if it is, I can't get it to work! Any help greatly appreciated.
Matt
Best Answer
-
Hi Matt,
You are correct the FIND() function is a part of it, the other function you'll need to use is LEFT() since you're looking to return all of the text to the left of the first / in the domains. This formula should work for what you're looking to do:
=LEFT([Column Name]@row, FIND("/", [Column Name]@row))
Hope this helps! Let me know if you have any questions.
Best,
Mike
Answers
-
Hi Matt,
You are correct the FIND() function is a part of it, the other function you'll need to use is LEFT() since you're looking to return all of the text to the left of the first / in the domains. This formula should work for what you're looking to do:
=LEFT([Column Name]@row, FIND("/", [Column Name]@row))
Hope this helps! Let me know if you have any questions.
Best,
Mike
-
Perfect Mike, worked first time, thanks!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!