I need you Excel geniuses to help me out here.
I have a cell that contains the street address, city, state, and zip for a list of customers. I need to separate that out to street address in one cell, and city, state, and zip in their own respective cells.
I.E.,
155 Any Road Austin TX 39934
to
155 Any Road
Austin
TX
39934
[edit: the dashes represent cells. A bunch of spaces doesn't work
]
The main problem is that the street addresses are of random lengths, in both pure number of letters, but also number of words. For example, a street address could be 155 Any Road Suite 1.
I've wracked my brains trying to figure out how to break this down in the easiest method possible. Anyone have any ideas?
Oh yeah, and VBA is not an option, because my bosses are cheapasses.
Any ideas would be great!
Posts
"Was cursing, in broken english at his team, and at our team. made fun of dead family members and mentioned he had sex with a dog."
"Hope he dies tbh but a ban would do."
If I could figure out a way to use a formula to move to the last full column and pull that out, it would be easier, but I can't figure out how to write a formula that includes a formula as a cell reference, even under r1c1.
Some days, the restrictions on Excel drive me crazy. :P
I realize that this may be impossible, and if so, I'll accept that, it would just save me a ton of work if I could automate at least a chunk of the process.
Thanks again!
Ah well, guess it's Typingfest 2010 for me!
Use INDIRECT()
e.g.
=INDIRECT("A3") will return the contents of A3
Maybe use "COUNTA()" to count the non-blank cells
and go something like (assuming on row A):
Last filled column (in A1)
=COUNTA( A10:A20 ) + 10
Last column (in A2)
=INDIRECT( "A" & A1 )
I have to leave for work now, so I'm typing this quickly.
There may be errors!
Theres no reason that your bosses can disapprove of VBA by being cheapasses, the macro editor is built in and included with every copy of Office sold. Theres no licencing fees or extra software to buy. Alt-F11 opens the macro editor. Save the results as a new template rather than inside the current spreadsheet if you want to be able to use it in other documents as well.
I could write this for you but im sure theres someone that can get it done way faster than i can, it takes me forever to write new VBA macros.
Check out my band, click the banner.
Zip Code (if cell is in A1): = right(A1,5)
State = mid(a1,len(a1)-7,2)
Street + City =left(a1,len(a1)-9)
If City is Always One Word: (if Street+City is in cell d1): =right(d1,len(d1)-search("%",substitute(D1," ","%",Len(D1)-Len(Substitute(d1," ","")))))
Then everything else is just: (Assuming city is e1): =left(d1,len(d1)-len(e1)-1)
Easy Peazy
Nintendo Network ID - PirateLuigi 3DS: 3136-6586-7691
G&T Grass Type Pokemon Gym Leader, In-Game Name: Dan
And durrrrrrrrr...I must have been thinking of another module. You're right, VBA is right there. Now to just teach myself how to use it. :P
I'll use your examples here as a good basis. Hopefully, when I have to do this again, I can have it all set up to do most of the work automatically!
Thanks homies!
If you're going that route anyways, at least let Excel help minimize the gruntwork.
Do a text to columns as best you can. The majority should fall into four columns the way you want them to be. Sort the results by column 5, then 6, then 7, etc. to get all the good ones clumped together and similar bad results clumped together.
Now as you go through and fix the anomalies you can throw in a bunch of concatenates here and there to speed things up, like if you see a whole slew of "Los Angeles" addresses broken up in a row.