How to fetch last 2 digits of a row in an excel file?

I have a scenario where I have 2 columns in an excel file. Now how can I fetch the last 2 numbers from the 2nd column for every row of an excel file?


First find the length of that string then use Remove method and mention like this:


Hi @vivek_Chowdary

You can do it by following the below steps…

  1. Read the excel data to a datatable using Read Range activity.
  2. Use a For Each Row activity to loop through the datatable.
  3. Use an Assign activity within the loop with below condition

This is for your reference.

1 Like


Thanks for your response. But, its not working.

Does it throw any error? Can you share the workflow file so I can look into it

yeah sure (16.4 KB)

In the 2nd column of the excel file there are many fields and I would like to loop through them and select only the last 2 digits of each row.

Hi @vivek_Chowdary

I went through the workflow as well as the excel…

In the excel file, you have not included the column headers. So, in the workflow, you cannot specify “URL” because it will not find the appropriate column. So, I used the column index instead to locate the column that contains the URL info.

Also I added a For Each Row activity to loop through the datatable. Did some changes to the expression used to get the last two digits… Now it’s working fine…

Main.xaml (6.9 KB)

If this solves the prob, please mark it as the answer so that it will help others as well :slight_smile:

Thanks! It really helped the purpose.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.