Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a very long worksheet list with contact information of various companies and I need to create usernames for them, so I would use the middle part of their website URL for those. For example, in cell B1 I have www.yourdomain.com and I want to copy the yourdomain part to cell A1.

Many websites may have a different top-level domain than .com, but all of them start with 'www.', in the case of 'www.yourdomain.something.com' I would only need the 'yourdomain' part, so from the first dot till the next dot.

Is there a function to accomplish this?

share|improve this question
add comment

1 Answer

Not tested in OpenOffice but the following should work and may tide you over until better answers are offered. Use the formula in A1 as shown (copy down as necessary):

SU490624 example

The formula is a little convoluted, so I have shown a way to build it up piece by piece which may also be a help in explaining it.

[Assumes a maximum initial string length of about 50 characters.]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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