Help with Address Formula

S

Steve M

I am looking for a formula that will return all words except for the last
word.
Eample:. in cell A1 I have: Castleton Parkway Blvd--I want to return in
cell A2: Castleton Parkway

TIA
 
D

Dave Peterson

One way:

=MID(A1,1,LEN(A1)-FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)
-LEN(SUBSTITUTE(A1," ","")))))
 
T

Teethless mama

Try this:
=LEFT(A1,FIND("^",SUBSTITUTE(A1," ","^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
 
S

Steve M

When I use this formula it returns Cast. I might mention also that there
would usually be a number in front of the street address (e.g. 125 Castleton
Parkway Blvd--in such a case I would want the result of the formula to be
125 Castleton Parkway).
 
V

vezerid

Just a minor modification of Dave's formula:

=MID(A1,1,FIND(CHAR(1),SUBSTITUTE(A1,"
",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1)

HTH
Kostis Vezerides
 
D

Dave Peterson

Thanks for the correction...

And just because of the unfortunate line wrap:

=MID(A1,1,FIND(CHAR(1),
SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top