One Column into 4 Columns without Text to Columns method

rwhite0823

New Member
Joined
Dec 20, 2017
Messages
7
I need help on how to take one column with an address and make it into multiple columns without using the Text to Columns method.

My example address looks like this:

[TABLE="width: 216"]
<tbody>[TR]
[TD="class: xl65, width: 216"]2000 STREET ADDRESS DR
CITY, STATE 20000[/TD]
[/TR]
</tbody>[/TABLE]

After I copy and paste that into a multiple column cell, I would like to have it in 4 columns going across:

2000 STREET ADDRESS DR CITY STATE 20000

I know there is the left, mid and right functions but I don't know how to do what I need. I would appreciate help.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
@rwhite0823, these things can be very tricky. There's no one-size-fits-all approach (formula or VBA) because the lengths and formats of street addresses vary greatly, as do the number of words in city/town names; so there are no clear delimiters.

However, if every one of your addresses is set up exactly like the example in your original post above (i.e., with a line break after the street address, a comma and space after the city name, and a single space between the state and zip code, the following formula may work for you. This formula was written with ease in mind, so it actually combines four different formulas into one; and it assumes that your first address resides in A2 and, therefore, that the formula would first be placed in B2:

Code:
=CHOOSE(COLUMN()-1,LEFT($A2,FIND(CHAR(10),$A2)-1),MID($A2,FIND(CHAR(10),$A2)+1,FIND(",",$A2)-(FIND(CHAR(10),$A2)+1)),MID($A2,FIND(", ",$A2)+2,FIND(" ",$A2,FIND(", ",$A2)+3)-(FIND(", ",$A2)+2)),TRIM(MID($A2,FIND(" ",$A2,FIND(", ",$A2)+3)+1,20)))

Once this is in B2, drag-copy it across to E2.

Then select B2:E2 and drag-copy down as far as your addresses go in column A.

NOTES:

• If your addresses vary from exactly what you've shown, this will not work.
• If your addresses don't reside in Column A, or if you are not able to place the results in B:E, the formula will need to be adapted. (Provide specifics if this is the case.)
• If your addresses start in a row other than Row 2, the formula will need to be adapted (i.e., every instance of "$A2" will need to be changed to reflect the actual cell in column A where your original addresses start.
 
Upvote 0
Assuming Erik's assumptions are correct, then here is a set of formulas crafted for the column they are in. Assuming your first address is in cell A1, put these formulas in the indicated cells and copy them down to the bottom of your data...

B1) =REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),"")

C1) =REPLACE(LEFT(A1,FIND(",",A1)-1),1,FIND(CHAR(10),A1),"")

D) =REPLACE(LEFT(A1,LEN(A1)-6),1,FIND(",",A1)+1,"")

E1) =RIGHT(A1,5)

Note: If your STATE text are always 2-letter postal abbreviations, then you can use this much simpler formula in cell D1...

=MID(A1,LEN(A1)-7,2)
 
Upvote 0
@Rick, we certainly don't know a whole lot here. I wanted to leave room for the possibility that the zip codes may vary between 5 and 10 characters.

I always seem to bypass the REPLACE method, which certainly comes in handy over others at times. Thanks for the reminder.
 
Upvote 0
@Rick, we certainly don't know a whole lot here. I wanted to leave room for the possibility that the zip codes may vary between 5 and 10 characters.
I assumed that since the OP did not use ZIP in his example, but rather used a 5-digit number instead, that he was indicating his Zip field consisted of only 5 digits. However, if it turns out that the OP could have a mix of 5-digit and 10-character Zip Codes, then he could use these modifications to the formulas I posted earlie

B1) =REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),"")

C1) =REPLACE(LEFT(A1,FIND(",",A1)-1),1,FIND(CHAR(10),A1),"")

D1) =REPLACE(LEFT(A1,LEN(A1)-6-5*(LEFT(RIGHT(A1,5))="-")),1,FIND(",",A1)+1,"")

E1) =RIGHT(A1,5+5*(LEFT(RIGHT(A1,5))="-"))

Note: If your STATE text are always 2-letter postal abbreviations, then you can use this much simpler formula in cell D1...

=MID(A1,LEN(A1)-7-5*(LEFT(RIGHT(A1,5))="-"),2)
 
Upvote 0
I have one additional question, how could the proper function be nested into the formula?
Just place PROPER( after the equal sign and ) as the end. So, this formula which I proposed for cell B1...

=REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),"")

would become this...

=PROPER(REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),""))
 
Upvote 0
Just place PROPER( after the equal sign and ) as the end. So, this formula which I proposed for cell B1...

=REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),"")

would become this...

=PROPER(REPLACE(A1,FIND(CHAR(10),A1),LEN(A1),""))

Thanks Rick!

I was given a new format if you have any thoughts on how to handle this I would appreciate it.

Example: (One Column)

DAVID A MILLER [123 BRIDGE STREET, CAMP SPRINGS, FL 21837]


I would like to have it: (5 Columns)

David A Miller 123 Bridge Street Camp Springs FL 21837
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: data"]
<tbody>[TR]
[TD]DAVID A MILLER [<small>505 BRIDGE STREET, MARDELA SPRINGS, MD 21837</small>] [/TD]
[/TR]
</tbody>[/TABLE]
</body>
 
Upvote 0
Thanks Rick!

I was given a new format if you have any thoughts on how to handle this I would appreciate it.

Example: (One Column)

DAVID A MILLER [123 BRIDGE STREET, CAMP SPRINGS, FL 21837]


I would like to have it: (5 Columns)

David A Miller 123 Bridge Street Camp Springs FL 21837
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: data"]
<tbody>[TR]
[TD]DAVID A MILLER [<small>505 BRIDGE STREET, MARDELA SPRINGS, MD 21837</small>] [/TD]
[/TR]
</tbody>[/TABLE]
</body>
Assuming your first piece of data is in cell A1, put these formulas in the indicated cells and copy them down to the bottom of your data...

B1) =PROPER(LEFT(A1,FIND("[",A1)-2))

C1) =PROPER(REPLACE(REPLACE(A1,FIND(",",A1),99,""),1,FIND("[",A1),""))

D1) =PROPER(REPLACE(LEFT(A1,LEN(A1)-11),1,FIND(",",A1)+1,""))

E1) =MID(A1,LEN(A1)-8,2)

F1) =MID(A1,LEN(A1)-5,5)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top