Posted: 2014-07-02 10:47 |
We were recently asked to create a formula which returns the domain for email addresses. For example, 'support@workbooks.com' would return 'workbooks.com'. You can do this using the Substring Index formula.
This will return the substring from a string 'str' before, 'count' occurrences of the delimiter 'delim'. If 'count' is positive, everything to the left of the final delimiter (counting from the left) is returned. If 'count' is negative, everything to the right of the final delimiter (counting from the right) is returned. In our example you would use the following formula:
This formula says find the first instance of the '@' symbol and return everything to the right, with counting starting from the right. If we had set the count to '1', this would return everything to the left of the first instance of the '@' symbol (support).
|