seperating an address by street address, unit #, city, state and zip that has no commas

michnance

New Member
Joined
May 8, 2019
Messages
9
I have a 15,000 line spreadsheet where the addresses are listed with the street address then unit number then city then state code and zip separated by spaces within a single cell. A1 Example:

23 NW 27th Lane Cape Coral FL 33993

I need the address to split like so:

23 NW 27th LaneCape CoralFL33993

<tbody>
</tbody>


<colgroup><col></colgroup><tbody>
</tbody>
<strike></strike>
After trying myself I have adding all states listed by two letter state abbreviation in column I starting a row A, if that is helpful in anyway. If not, I can obviously deleted column.

I would so appreciate any help getting this split.
All searches are showing how to do it when there is a comma following street address and another following city. PLEASE HELP!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
with your example:

try PowerQuery (Get&Transform)

adrText Before DelimiterText Between DelimitersText Between Delimiters.1Text After Delimiter
23 NW 27th Lane Cape Coral FL 3399323 NW 27th LaneCape CoralFL33993

Code:
[SIZE=1]// Table10
let
    Source = Excel.CurrentWorkbook(){[Name="Table10"]}[Content],
    Before = Table.AddColumn(Source, "Text Before Delimiter", each Text.BeforeDelimiter([adr], " ", 3), type text),
    Between = Table.AddColumn(Before, "Text Between Delimiters", each Text.BetweenDelimiters([adr], " ", " ", 3, 1), type text),
    Between1 = Table.AddColumn(Between, "Text Between Delimiters.1", each Text.BetweenDelimiters([adr], " ", " ", 5, 0), type text),
    After = Table.AddColumn(Between1, "Text After Delimiter", each Text.AfterDelimiter([adr], " ", {0, RelativePosition.FromEnd}), type text),
    #"Removed Columns" = Table.RemoveColumns(After,{"adr"})
in
    #"Removed Columns"[/SIZE]

column names can be changed of course, it's cosmetics ;)
 
Last edited:
Upvote 0
with your example:

Sandy666:
Thank you SO much for your reply. I truly hate to ask another question but I've never used a PowerQuery before. Can you tell me where I am supposed to enter the code you provided? Again, I truly appreciate all of your help!
 
Upvote 0
too much typing :)
here is excel file: example

Data - Show Queries - dbl click on table there - Ribbon - Advanced Editor - and you'll see the same M-code as in the post
 
Upvote 0
I am not sure what Sandy's solution will do (I do not do PowerQuery), but to my way of thinking what you want to do will be near impossible. The problem stems from the fact that street names and city names can be composed of multiple "words" in any combination. Without a delimiter, there is no simple way to figure out where the street name ends and the city name begins.
 
Upvote 0
Right Rick, but I bolded: with your example (btw. example is not representative).
 
Upvote 0
too much typing :)

sandy666,
Thank you so much! I have never done anything as advanced as a power query. I am not sure if this is allowed on this forum but is there any chance you would connect with me outside of this site? email or phone? happy to pay you for your help! lmk!!!
 
Upvote 0
thank you so much for your reply. i know a comma after street address would change this entire situation for me! thanks for your input!!!
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

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