Text field may contain a 5 digit code, and if so need to extract it to its own column

Copper Contributor

So my title data sometimes contains a code that tells me important information about the item, my ultimate goal is to use this code with a vlookup function to autofill other fields. My problem is that it is intermingled with other information ex:

13112 Way to Celebrate Men's & Big Men's Hoppy Halloween Graphic Tee Small

I think what I need is a function that will see that there is a 5 digit numeric value contained within the text and move only that number to a new field that I could then use for the vlookup function.

2 Replies

@Modnar1 

 

=LET(
a,--LEFT(A1,5),
IF(ISNUMBER(a),a,"")
)

 

Hello @Modnar1 

 

If they data are in the same format (the numbers you need to extract) is 5 digits and always at the beginning of the text, then you would use this formula

=LEFT(A1,5)   --> this way the result will be 13112 as a text 

=NUMBERVALUE(LEFT(A1,5))  --> the result will be converted into numbers,