Separate text string into separate columns in Excel

4

1

I need an Excel formula to separate multiple names currently in one column into three. One single cell currently contains: Jackson Hakel Brynn Holohan John Holohan. I need three columns with first & last name, i.e.:

Column1          Column 2          Column3
Jackson Hakel    Brynn Holohan     John Holohan.

Spoon

Posted 2016-02-19T18:08:27.663

Reputation: 41

Welcome to Super User! Although there are some answers below, please understand this is not a service site. We can help you with specific question you have, but we are not here to deliver a completed product for you to use. Please add details of what you have tried so far, including scripts, code or formulas, and we will try to help. If you need more help, check out *[ask]* in the *[help]*. – CharlieRB – 2016-02-19T19:38:22.713

1You could use Text to Columns (under Data tab), and use a space delimiter to separate them. Then you'll have a name in each column, and just concatenate every two. – BruceWayne – 2016-02-19T19:39:28.437

You originally tagged this [google]. Is this on Google Spreadsheets? – Excellll – 2016-02-19T21:37:21.137

Answers

3

With a constraint / assumption that there's one space between each first name & last name and this repeats for 3 names, and there's no fourth name therein try the following.

Assuming your data is in cell B4

Cell C4

=LEFT(B4,SEARCH(" ",B4,SEARCH(" ",B4)+1)-1)

Cell D4

=LEFT((RIGHT(B4,LEN(B4)-LEN(C4)-1)),SEARCH(" ",(RIGHT(B4,LEN(B4)-LEN(C4)-1)),SEARCH(" ",(RIGHT(B4,LEN(B4)-LEN(C4)-1)))+1)-1)

Cell E4

=RIGHT(B4,LEN(B4)-(LEN(C4)+LEN(D4)+2))

patkim

Posted 2016-02-19T18:08:27.663

Reputation: 3 699

2

I will show you a very basic example which you should be able to use similarly in your case. I kept the formulas broken apart to make learning easier.

enter image description here

First I start with some data, split by a space like you have. Essentially you want to delimit your data at every other space so that is what I will do.

First I find the location of the first space:

enter image description here

Secondly I find the location of the second space, starting from where we found the first one:

enter image description here

Now that we know the location of the second space, simply trim the original text up to the second space:

enter image description here

Lastly, show the remaining text with the front trimmed off:

enter image description here

Now to keep splitting apart, simply repeat the previous methods from the last cell. As I stated in the beginning, the formulas are broken apart so you can learn but to simplify how much space is taken up, you can combine formulas.

Hope this helps!

Eric F

Posted 2016-02-19T18:08:27.663

Reputation: 3 070

2

With data in A1, in B1 enter:

=TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:A)*999-998,999)) & " " & TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:B)*999-998,999))

In C1 enter:

=TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:C)*999-998,999)) & " " & TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:D)*999-998,999))

and in D1 enter:

=TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:E)*999-998,999)) & " " & TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",999)),COLUMNS($A:F)*999-998,999))

enter image description here

Gary's Student

Posted 2016-02-19T18:08:27.663

Reputation: 15 540