In a previous post we explained how to separate names using Microsoft Excel’s text to columns function. But, what if your data is a little more complicated, like an address? In this post we’ll walk you through some more advanced techniques with Microsoft Excel’s text to columns function. We’ll be using Excel 2007 for this tutorial but the concepts are the same for other versions of Excel. If you do have a different version of Microsoft Office and need some help with this function leave a comment below and we’ll be happy to help!
Note: This post may contain affiliate links.
Excel Text to Columns to Separate Addresses
The technique you use to separate your address into multiple columns in Excel will depend on how your information is stored. In this example, the address column was separated into two lines, the street address on the first line and the city, state, zip on the second line.
Also Read: How to Combine Cells in Microsoft Excel
Separate the Two Lines into Two Separate Columns
- Make sure there is an empty column to the right of the address. In our example our address is in column B and column C is empty so we’re ok. If column C also had data in it we would highlight column C and click on insert from the home menu. That would insert a blank column before column C.
- Select the column with the addresses in it. In our example, column B has the addresses so we would select the entire column by clicking on the letter B at the top of the column.
- Select the text to columns function from the data menu.
- When the text to columns wizard opens, select Delimited and click Next.
- In the 2nd wizard box uncheck all the boxes except for other. Then, put your cursor in the box next to other and type alt-010 (in other words, hold the Alt key down and type 010). The box may look empty or have a period in it but if you look below you will see that the data is split into two columns right where it was split into two lines. That’s because Alt-010 is the code for line feed. Click next.
- The last box of the text to columns wizard allows you to define the type of data in your resulting columns. We don’t need to do anything in this box so click finish.
- Your address will now be split into a street address column and a city, state and zip column.
Note: You also may be interested in how to convert multiple pages in excel into one pdf.
Separate the City, State and Zip into 3 Columns
Now say we want to sort our data by state or filter out only certain cities. That will be easier if the city, state and zip were each in their own column. There are several ways to do this. Here’s one way:
- Since we’re going to take our city, state and zip column and separate it into three columns we need to make sure we have two empty columns to the right of the city, state, zip column. In our example we do so we’re all set. If we didn’t have two empty columns we would select the column to the RIGHT of our city, state and zip column and click insert on the home menu two times. This would insert two empty columns.
- Now, to separate the city, state and zip, highlight that column by selecting the letter at the top of the column and select text to columns from the data menu.
- Again, when the text to columns wizard opens, select delimited from the 1st window and click next.
- Our city, state and zip are separated by commas so in the 2nd box of the wizard we’re going to uncheck every box except for the one that one next to the comma. Then, by looking at the data in the bottom of the window we can see this will separate the city, state and zip exactly the way we wanted so we click next.
- This time, in the 3rd box of the wizard we are going to identify a data type. We’re going to identify the data type for the zip code column. This is because if we don’t Excel may assume these are numbers and cut off any zeros in the beginning of the number. So, a zip code of 01234 would only show up as 1234 and cause problems. So, in this box we’ll highlight the zip code column at the bottom of the window by clicking in it and at the top we’ll select text. This will force Excel to store the zip codes as text instead of numbers. Then we’ll click finish.
- After adding some titles to our new columns are spreadsheet is all set and ready to go with the addresses split into appropriate columns for sorting or doing mail merges.
Again, depending on how your data is structured you may have to play around with the delimiters you select in step 2 of the text to column function but the preview at the bottom of that window should help you make sure you select the right combination for your data. Or, if you get stuck, feel free to leave a comment below and we’ll help out.
Separating out the address components into separate columns will make it easier for you search your data, filter it and/or complete mail merges for printing envelopes or labels. We’ll cover a few of these techniques in future posts so make sure you subscribe below so you don’t miss them.