Easy? Remove "St., Rd., or Ave" Suffix from address

jeffcoleky

Active Member
Joined
May 24, 2011
Messages
274
I'm trying to remove the suffix in some addresses so that it only reads the first part of the street address.

The catch is that sometimes there is a ZIPCODE in the same field and sometimes there is not. Also, sometimes it reads "Ave, Rd. or St." and sometimes "AVENUE, ROAD, STREET".

The wording of the formula might be, "remove the last word from the cell up to the first space unless there is a number also in which case remove the last TWO"

I used this code but if there is more than one word in the address it doesn't extract them both: =LEFT($A2,FIND(" ",$A2,8)-1)

Here's the sample data:
Excel 2010
AB
1Before
Desired Output
21585 SOUTH 15TH STREET 589281585 South 15th
31358 DIXDALE AVENUE 582181358 Dixdale
45815 LAMOND DRIVE5815 Lamond
55325 HAVENTREE PLACE5325 Haventree
65383 WOLF PEN TRACE 588595383 Wolf Pen
75929 BAY HARBOR DRIVE5929 Bay Harbor
82527 WEST BURNETT AVENUE 2527 West Burnett
97985 PICKWICK LANE7985 Pickwick
102815 FARNSLEY ROAD 582132815 Farnsley
112131 SADIEVILLE DRIVE 582172131 Sadieville
125788 VARBLE AVENUE 582115788 Varble
137218 PEPPERMILL DRIVE 582287218 Peppermill

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Is there an easy way to do this?
 
If your prepared to use some code , this should do the job.
Code:
[COLOR=Navy]Sub[/COLOR] MG20Jun30
[COLOR=Navy]Dim[/COLOR] Rdtype      [COLOR=Navy]As[/COLOR] [COLOR=Navy]String[/COLOR]
[COLOR=Navy]Dim[/COLOR] Rng         [COLOR=Navy]As[/COLOR] Range
[COLOR=Navy]Dim[/COLOR] Dn          [COLOR=Navy]As[/COLOR] Range
[COLOR=Navy]Dim[/COLOR] Wd
[COLOR=Navy]Dim[/COLOR] Stg         [COLOR=Navy]As[/COLOR] [COLOR=Navy]String[/COLOR]
[COLOR=Navy]Dim[/COLOR] n           [COLOR=Navy]As[/COLOR] [COLOR=Navy]Integer[/COLOR]
Rdtype = "AVENUE/ROAD/LANE/DRIVE/PLACE/TRACE/STREET"
[COLOR=Navy]Set[/COLOR] Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
    [COLOR=Navy]For[/COLOR] [COLOR=Navy]Each[/COLOR] Dn [COLOR=Navy]In[/COLOR] Rng
        Wd = Split(Dn, " ")
    [COLOR=Navy]For[/COLOR] n = 0 To UBound(Wd)
        [COLOR=Navy]If[/COLOR] InStr(Rdtype, Wd(n)) > 0 [COLOR=Navy]Then[/COLOR] [COLOR=Navy]Exit[/COLOR] For
            Stg = Stg & " " & Wd(n)
        [COLOR=Navy]Next[/COLOR] n
            Dn.Offset(, 1) = Mid(Stg, 2)
            Stg = ""
    [COLOR=Navy]Next[/COLOR] Dn
[COLOR=Navy]End[/COLOR] [COLOR=Navy]Sub[/COLOR]
Regards Mick

Mick,

Can you modify the code to include removing the Zip Code if present also please?
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
No problem :) Glad I could help (y) Appreciate the feedback!
 
Upvote 0

Forum statistics

Threads
1,216,731
Messages
6,132,390
Members
449,725
Latest member
Enero1

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