Hi,
I have a list of account numbers in the following variations:
AAA123456ISA
AAA123456ISAB
AAA123456IF
AAA123456IFB
AAA123456SIPP
AAA123456SIPPB
BBB123456ISA
BBB123456ISAB
BBB123456IF
BBB123456IFB
BBB123456SIPP
BBB123456SIPPB
Basically, I need to be able to extract account numbers from my computer system and check that they have been set up in the correct format. Since there are thousands of account numbers I obviously wanted an automated process to do this. At the moment, I am using the following formula:
=IF(OR(RIGHT(A2, 3)="ISA", RIGHT(A2, 4)="ISAB", RIGHT(A2, 2)="IF", RIGHT(A2, 3)="IFB", RIGHT(A2, 4)="SIPP", RIGHT(A2, 5)="SIPPB"), "", "ERROR")
which is rather clumsy. It is basically checking the last 3,4, or 5 digits of the account number and returning an error message if an incorrect format has been input. However this doesn't check the prefix of the account number (AAA or BBB) or if there are any other errors, for example:
AAA123456-ISA (note, the dash)
Please can anyone help me with a more thorough and efficient way of validating these account numbers?
Thanks
Bookmarks