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.4K Get Help
- 424 Global Discussions
- 221 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 62 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!