Trying to separate millions of street names from their suffixes ("Ave", "Dr", "St", etc.) in Excel. Sometimes streets do not have a suffix, so an empty cell is needed for those.
I tried using a formula at first, but ran into some issues:
Listed the suffixes with the highlighted example formula below and then using CONCAT in the last column to get them all in one column , but sometimes it also grabs directionals ("S", "N", "E", "W") after the suffix,
lists two suffixes with the same letters (e.g. "CI", "CIR"),
or grabs the street name if it includes the same letters as a suffix (see "ST" column).
I've also tried Flash Fill, but this yields worse results.
I came to the conclusion VBA would be most efficient because I will have to repeat this process for multiple datasets, but if there are other suggestions I am open.
I am very novice in VBA, but this is what I have so far and I'm not sure how to expand/continue it:
Sub getSuffix()
Dim i As Range
For Each i In Range("A1")
Do
If InStr(ActiveCell.Value, " AVE") > 0 Then
ActiveCell.Offset(0, 1).Value = "AVE"
ActiveCell.Offset(1, 0).Select
Else
If IsEmpty(ActiveCell.Value) Then
Exit For
End If
End If
Loop
Next i
End Sub