I need help. I developed an Excel sheet that as I scan an employee barcode it will extract the base-32 code information so I can get the employee ID number, first name and last name using different formulas. Excel Sheet

The only problem is the formulas to extract this data is different based on how the code starts out as seen in the Excel Sheet. I can use the IFS formula in Excel on O365 but all of our agencies use the standard desktop version of Excel.

My question; is there a way to code out in VBA that when an ID is scanned, regardless of what the scanned code starts with, that it will perform the needed formula to extract the three items I need which is ID, first name and last name? Below are the formulas I use:

Base-32 =MID(A2,2,7)

First Name =PROPER(MID(A2,17,20))

Last Name =PROPER(MID(A2,38,20))

Base-32 =MID(A3,9,7)

First Name =PROPER(MID(A3,16,20))

Last Name =PROPER(MID(A3,36,26))

Base -32 =MID(A4,8,7)

First Name =PROPER(MID(A4,15,20))

Last Name =PROPER(MID(A4,35,20))

The ID number for each of them is calculated the same (based on the cell the scan goes in to) using:

=IF(C2="","0",SUMPRODUCT(POWER(32,LEN(C2)-ROW(INDIRECT("1:"&LEN(C2)))),(CODE(UPPER(MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1)))-48*(CODE(MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1))<58)-55*(CODE(MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1))>64))))

Thank you in advance to anyone that can help.