I've ready many articles on this but cannot find a solution for this. Is there a way to set up a table of values that a formula can reference to avoid?
This is a common issue with names too, and unfortunately, there is no foolproof method. If you could could up with a method to handle 95% of your cases, you would be doing really well. But then you would still need to go through and review all the records afterwards for accuracy.
The issue is that there is just so many different possibilities to check for, and so many different variations of the same thing.
You haven't even touched on Apartment numbers in the addresses (i.e. Apartment, Apt, #, Front, Back, etc).
And the issue with letters like N, S, W, E, you have to check just for those values by themselves, and not in the middle of other words.
Here is how I might approach this, though depending upon how much data you have it could be really slow, as it involves lots of loops.
1. Create a list of all possible values you may want to exclude and store it in an Excel sheet
2. Loop through each row of data.
3. Remove everything before the first space (the number)
4. For each row of data, use the SPLIT function in VBA to separate each word into its own field.
5. Loop through each word and see if they exist in your list of excluded values (you could use a MATCH or COUNTIF function instead of looping through each word in the exclusion list)
6. If the word is not found in your list, keep it and add it to the string to return.
7. Check the next word in your split list and repeat the process
8. When done loop through all the words from the row, return the string you are left with
Not the most efficient thing, but I cannot conceive any easier way to do something like this.