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 the following data in cells

1 [Chelsea-QPR]
2 [Liverpool-Sunderland]
3 [NewcastleUtd-Everton]

I want to separate the team names into two different cells. How can I do this?

share|improve this question
add comment

2 Answers

With data in A2 try this formula in B2

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

and in C2

=SUBSTITUTE(REPLACE(A2,1,FIND("-",A2),""),"]","")

share|improve this answer
    
the =mid formula is returning the right text but in all the results the first letter is missing for example helsea, iverpool, ewcastle etc –  Aasim Azam Jan 7 '13 at 15:14
    
I changed the =MID(A2,2,FIND("-",A2)-2) formula to =MID(A2,1,FIND("-",A2)-2) –  Aasim Azam Jan 7 '13 at 15:15
    
I was assuming that the brackets were part of the text in those cells - hence why the MID function used 2 not 1, if the brackets are not there then you can also simplify the second formula , SUBSTITUTE is not required so that becomes just =REPLACE(A2,1,FIND("-",A2),"") –  barry houdini Jan 7 '13 at 16:08
    
I see, I didn't have time to format the text as cells and columns so I did this in a hurry. I understand. Thanks –  Aasim Azam Jan 7 '13 at 16:13
add comment
up vote 1 down vote accepted

To do this I used the Text to columns feature under the Data tab and used "-" as the delimiter.

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.