How to check whether a cell contains a valid percentage value?

Hi, I’m new to UiPath so I’m hoping someone can help me with this problem.

I want to check whether the cells in a certain column contain a valid percentage, so the format has to be 0 - 100%, where just the numbers without the “%” symbol is invalid.

So far I have read the column, but when I’m checking the cell value I’m using “row(x).toString” and that is where the problem is. When I’m dealing with a valid percentage, the value changes so 100% becomes 1, 50% becomes 0.5 etc.

I was planning on using Is Match for my check but that can’t be used now that the value changes when I use “.toString”.

Please let me know if you know how to solve this. Thanks in advance!

Hi @thordis,

Can you share sample excel file so can check.

Hi @Jyotika_Halai,

Since I’m new to UiPath Forum I’m not allowed to share a file. But my example file contains the following in column A:

100%
25%
100%
100%
75%
100%
100%
50%
100%
100%
100%
100%
100%
100
100
100
100
100
100
75
100
100
100
100
100
100
100
75
100
100

Hope that provides enough information, but please let me know if you have any questions.

Hi,

Can you check PreserveFormat property of read range activity and try it.

3 Likes

Thank you so much, it works! But when I checked the PreserveFormat and read the whole file, the running time was to slow. So I just checked it and used read cell for the relevant column and it works perfectly.

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