Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .