Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Splitting Space Separated Items into Columns in Excel

Posted on 2014-09-13
8
Medium Priority
?
459 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 300 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 1400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 300 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 71

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

722 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