Alright, so bear with me...this is ugly and there could be some opportunity to clean this up (or a better approach altogether utilizing the same concepts) and since you already know that this is a much better candidate for RegEx/VBA, we are in agreement of a better approach, yet under the criteria/restrictions of your question, here we go...
Since you said the length varies between 2 and 12, we can make a set of array formulas in 12 columns, B-M
which extracts the RIGHT()
of 1, 2, ..., 12 characters accordingly. We wrap this with a VALUE
to return an error #VALUE!
for non-numerics -- NOTE: This formula is entered by first selecting cells B2:M2
, typing the formula, =VALUE(RIGHT(A2, {1,2,3,4,5,6,7,8,9,10,11,12}))
and then the obligatory CTRL + SHIFT + ENTER
We then find the position of the first error in COLUMN O
with a MATCH()
formula looking for the first TRUE
of another array formula utilizing ISERROR()
.
We get the solution by doing an index of the position 1-12 columns returning the column next to the first error it finds. This is because you know that column A will always end in a number.
N.B. Since you specified that it is only a 4-digit numeric string at the end, you can probably get away with reducing this method to the first 4 columns; that is, rather than utilizing 12 columns, just use columns B:E
and continue as above.

We end by begging the client/customer to consider a .xlsm
workbook/VBA/RegEx or other solution...