Solved

Splitting Space Separated Items into Columns in Excel

Posted on 2014-09-13
8
430 Views
Last Modified: 2014-09-18
When Mailchimp does an export of their standard address fields, it places the information into ONE CELL of the spreadsheet separated by double spaces:  (Look at the "address" section on this page:  http://kb.mailchimp.com/lists/growth/format-list-fields)

So my cell in Excel looks like this: Address1spacespaceAddress2spacespaceCityspacespaceStatespacespaceZip

Is there a formula or process in Excel that could be used to split those items into their own separate cell (column) in the spreadsheet?

The bottom line is I want to print address labels from the spreadsheet so an alternative would be producing address labels from that type of cell.

Thanks.
0
Comment
Question by:pkonstan1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 40

Assisted Solution

by:als315
als315 earned 75 total points
ID: 40320808
You can use VBA split function, if you can use macros or formula from this sample
BkSplit.xls
0
 

Author Comment

by:pkonstan1
ID: 40320853
That is 90% of what I need.  
It works great when there are two address lines.

But when I have only one address line it fails. So can the macro be set up to allow for a BLANK Address2 field?

I also forgot that the country is at the end in a two digit code. So the CORRECT input field will be like this

Address1spacespacespacespaceCityspacespaceStatespacespaceZipspacespaceAA

And needs to be split into columns: Address1, Address2, City, State, Zip, Country

This is just what I was looking for, but I'm not super familiar with Excel formulas. I've written thousands of lines of PHP code and I could do it in a flash with PHP, but my brain doesn't dive into Excel much.  Thanks
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 350 total points
ID: 40320963
Have you tried the Text-To-Columns feature (Excel menu: Data, Text-To-Columns)?  

After your data is inserted into column A, select TTC, then choose "delimited" and click the "Next" button. On the next screen, choose "Other" for delimiter and enter two spaces, then click the "Finish" button.  This should split your data.

Regards,
Glenn
Sent from my Windows Phone
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 75 total points
ID: 40320997
See revised and simplified XLS if you want to do it via formula.
BkSplit.xls
0
 

Assisted Solution

by:pkonstan1
pkonstan1 earned 0 total points
ID: 40321016
The formula provided by Olemo works fine when there is only ONE Address line, but it doesn't work when there are two.

So this address works:
1 Address1 St
City, State Zip

But this doesn't:
1 Address 1
Apt #2
City, State Zip

Then for Glenn Ray's offering, it "almost" works but can be made to work with one extra step and one specification.  The problem is that the "other" delimiter only allows for a single character to be entered, so the "two-space" option doesn't work.  The other problem is it converts zip codes with a leading zero to numeric and drops the zero.

Work Around for Single Character Entry.
The simple work around is to do a Search and Replace first and search for all double spaces and replace with some unused character (semi-colon or pip or left bracket...etc).  Then use that character as your delimiter.  

Be Sure To Specify Zip Code as "Text"
Then when you get to the screen that allows you to specify column types, switch the column for zip code from "general" to "text".

That's it.  Works perfect. Just what I needed.  Thanks.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 40321050
Don't agree to the statement. The example workbook shows two different address sets, with one and with two address lines. Both work. Address lines are always in columns B and C, City is always in column D, aso.

If you found the Text-To-Columns suggestion to work for you (with modifications), that one should get the lion's share of points.
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40321072
Yup, sorry I didn't know you couldn't specify more than one delimiter for "Other" (makes sense, actually).  But I was posting via mobile and couldn't test.  Your idea of replacing all double spaces with another delimiter (ex,, pipe "|") was a good one.  And yes,  you'd want to selectively change the column data type to "Text" as-needed (ex., zip codes).

Regards,
-Glenn
0
 

Author Closing Comment

by:pkonstan1
ID: 40329896
Pointing me to an unknown feature in Excel is just what I needed.  This is perfect. Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question