Dear all,
I'm trying to extract numbers from an Alpha-Numeric String.
I need to extract only the 1st 'n' digits from the Alpha-Numeric string where 1<n<=8.
Input Output Scenarios
ab1245678ab 1245678 Extracted 1st 8 digits [n=8]
ab124cd 124 Extracted 1st 3 digits (3<=8) [n=3]
ab12456789cd 1245678 Extracted 1st 8 digits only. Hence 9 is not present in the output [n=8]
abcd1234acdf12 1234 Extracted 1st 4 digits (4<=8) [n=4]
PFA for the sheet explaining the Condition and Scenarios
I do have a formula to extract numbers but I cannot restrict it to extract upto 1st 'n' digits:
Note1: If your input is in A1 then type your formula in B1. After you have written formula, you have to Press CTRL+SHIFT+Enter![]()
Please Login or Register to view this content.
Note2:This formula doesn't work for the last scenario mentioned above.
Also, keep in mind that I would work with dynamic Range of data.
I would like to achieve this through a macro if this would be efficient than writing formulas.
Any help would be much appreciated.
Thanks,
Vinod Krishna
Bookmarks