View Single Post
 
Old 10-02-2020, 10:11 AM
14spar15 14spar15 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default Extract the last number of the string under certain conditions

Hello, I need a formula to extract the last number (will always be a single number) from a string only if that number is preceded by a single letter or two letters and then another number (this second number mentioned will be a group of numbers. All of this is preceded by a group of letters. Example – ABC1234D5 would become ABC1234D, ABC123EF4 would become ABC123EF, ABC12345D would remain ABC12345D and ABC1234 would remain ABC1234. If the process needs to be spread out over a couple columns that’s fine. The original string always starts with one or more letters followed by a group of numbers (2-5 digits). Extracting the last number in the string that is not preceded by another number might also be an option here. The finished results needs to be letters-numbers-letters -or- letters-numbers and never letters-numbers-letters-number. Any help would be appreciated.
Reply With Quote