In my excel sheet i have a column in which some values are negative.How will i convert all those -ve values into 0 without changing other entries.
Hi @Soniya215
Welcome to the community!!!
Follow the below steps
- use read range activity to read the data in the excel to a datatable
- Use a for each row activity to loop through the datatable records
- In the loop, use an IF activity to check whether the value is minus or not.
Int.32.Parse(row(“ColumnName”).ToString) < 0
If true, then update the value in the row
row(“Column Name”) = (Int.32.Parse(row(“ColumnName”).ToString) * -1).ToString
- Now, write the data back into the excel using Write range activity
Hi @Soniya215, Welcome to Uipath Community
As @Lahiru.Fernando said clearly, crispy.
I’m just adding the example below.
- Sample.xaml (7.8 KB)
- Input.xlsx (8.2 KB)
Happy Learning !
what if the values in table are in decimal number
Thanks for your help.It worked sucessfully.
Send me work flow bro
Where can I use this formula ? I am confused on this. Please help me. I am also trying to achieve -ve to 0 in excel column.
You shouldn’t dig up a 3 year old post. Just create a new post with your question.There are new features to do this, use For Each Excel Row with an If and Assign.