God of Thunder
New Member
- Joined
- Dec 30, 2014
- Messages
- 6
Hi, I’ve been lurking here for years now – so thanks for all the help!
I’m currently validating customer address information in our system, and I’ve run into an obstacle checking for proper street abbreviations. I’ve been using this formula at present (probably lifted from an older post on this forum).
The referenced column on ‘Valid_Street_Types’ contains values like “Avenue”, “Boulevard”, and so on.
This looks for any of the full street names within the Street field. I also use a similar formula with a list of correct abbreviations (just looking at a different column on ‘Valid_Street_Types’, with values like “AVE”, “BLVD”, etc).
This has worked pretty well, but I’m hoping to eliminate false positives from unfortunately-named streets. For example: 555 Greenwood Dr. I’d like to confirm that "Dr" is present, but instead it finds the valid abbreviation "GREEN" first. Makes sense, since SEARCH is working from left to right.
So my thought was, searching from right to left would find “Dr” before “Green”. In general the clause I want to identify will be at or near the end of the string. So I reversed the string, reversed my abbreviations, and checked that way. And it still finds Green! (well, NEERG).
So at present I have this value in AL16:
And I’m hoping to find "rD" with the following (Column G contains my reversed abbreviations).
And it returns NEERG without fail, just like it found GREEN before I did the whole reverse thing. I’ve tried “FIND” instead of search (compensated for case when doing this) with no change.
Anyone have any insight into where I’m going wrong?
I’m currently validating customer address information in our system, and I’ve run into an obstacle checking for proper street abbreviations. I’ve been using this formula at present (probably lifted from an older post on this forum).
Code:
=IF($Y16="","",IFERROR(LOOKUP(2^15,SEARCH(Valid_Street_Types!$A$3:$A$143,$Y16),Valid_Street_Types!$A$3:$A$143),"[ERR]"))
This looks for any of the full street names within the Street field. I also use a similar formula with a list of correct abbreviations (just looking at a different column on ‘Valid_Street_Types’, with values like “AVE”, “BLVD”, etc).
This has worked pretty well, but I’m hoping to eliminate false positives from unfortunately-named streets. For example: 555 Greenwood Dr. I’d like to confirm that "Dr" is present, but instead it finds the valid abbreviation "GREEN" first. Makes sense, since SEARCH is working from left to right.
So my thought was, searching from right to left would find “Dr” before “Green”. In general the clause I want to identify will be at or near the end of the string. So I reversed the string, reversed my abbreviations, and checked that way. And it still finds Green! (well, NEERG).
So at present I have this value in AL16:
Code:
rD doowneerG 555
And I’m hoping to find "rD" with the following (Column G contains my reversed abbreviations).
Code:
=IF($AL16="","",IFERROR(LOOKUP(2^15,SEARCH(Valid_Street_Types!$G$3:$G$143,$AL16),Valid_Street_Types!$G$3:$G$143),"[ERR]"))
And it returns NEERG without fail, just like it found GREEN before I did the whole reverse thing. I’ve tried “FIND” instead of search (compensated for case when doing this) with no change.
Anyone have any insight into where I’m going wrong?