How to extract a specific numbering in the middle of text on a line in excel?


I’m trying to extract a numbering sequence in an excel spreadsheet, but I don’t know how to do that. This specific numbering is in the middle of other words and other numbers that will not be used.

I want to extract all the numbers starting with 531 or 553. The numbering that starts with 531 has 10 more numbers totaling 13 numbers. The numbering starting with 553 has 11 more numbers totaling 14 numbers.

These numbers are in each row of a column in excel. The problem is that, often, these numbers are accompanied by other texts or other numbers such as date of birth, license plate, date of sending file, document numbering, etc. There is no pattern.

These numbers can also be separated with blanks or periods and dashes.

Can someone help me?

Thank you

Let me give a try… Please provide a sample excel…

1 Like

The numbers are in the column “Assunto do E-mail:”

Busca_Excel.xlsx (11.9 KB)

@vinicius.botelho Can you tell us what is the output that you expect and in which format?


I will structure these numbers in another spreadsheet.

The result of this extraction will be the numbers in this format: 5312020181546

@vinicius.botelho Do you want these numbers in another Sheet of the Excel ?

In fact, I want these numbers in another spreadsheet and that will also have other information. My problem at this point is only in extracting these numbers.

@vinicius.botelho The above Scenarios are not present in the Excel. So if you can provide those kind of Scenarios, I mean the numbers being in that format, we can make sure we are covering all scenarios and giving you the right output.

There is no standard, the only certainty will be those numbers that start with 531 or 553.

There may be cases where these numbers will not be present. Where the field will be blank or will have other information but will not have that number.

@vinicius.botelho Check this Workflow :
I was not sure how to present the Extracted data, Hence I just used a Message Box :sweat_smile: . Check if that’s what you needed. If not, please explain in detail.
Data (11.0 KB)

Hi @vinicius.botelho,
Get the value from excel and then use that variable in if condition like this
If Variable.StartsWith(“531”) or Variable.StartsWith(“553”) in then By using regex you are able to get how many numbers you want there.
Happy Automation!