April 27, 2020, 2:29pm
I have a datatable variable dt in which I have datatable extracted from a excel.
In that datatable I need to add the values of two column together and paste it into the third.
Column A , Column B values added and a new column C is added to the same datatble and sum of column values of A and B pasted there i.e in column C
what’s the value on Column A and Column B??
is it Maths related or Just text?
April 27, 2020, 5:49pm
the value is math related. They are numbers
987989 ,9878.09 ,8678.98
Since this is extracted from Excel, This can be handled in the same itself.
write Cell with the Formula of Add Column A and B .
Then Auto fill range for the rest of the cell in the column.
I have created workflow based on your requirement please unzip and run check Test.xlsx file.
Here I took input for ColumnA,ColumnB and I added those two columns into ColumnC.
I hope you will get solution
AddTwoColumns.zip (20.1 KB)
@Karan28 if you find it useful mark it as solution and close the thread.
April 28, 2020, 9:46am
Hi thanks for the solution but I am getting this error
Get Row Item: StringConverter cannot convert from System.Double.
I am getting the same error but for a different post.
@Karan28 - I think it has something to do with being a string variable when it should be an integer variable.
if you have a datatable called
dt_ExcelData, with columns: Name, Salary & Bonus and you need a new column called Total Salary (Salary + Bonus)
Use Add new Column activity “Total Salary” - at the required place in your workflow
Add an assign activity
Put this in the left-hand side of the assign dt_ExcelData.Columns(“Total Salary”).Expression
Put this in the right hand side “Income+Bonus”
After this point you should now have the calculated value for all rows in the table without using a loop.
March 17, 2021, 9:03am
The calculated column “Total Salary” is changing after writing it into excel
another problem I am having is that the two columns Income and Bonus in my case these columns have space like “Income Value” and “Bonus Value” so how to manage when the column names are having spaces
please explain by screenshot based.
The example is available in the Uipath docs.
I have used same file from example and added write cell to it.
write in the 1st cell with the required formula .
Auto fill range from written cell till the end of the range.
Thankyou , It was very helpful.
here we go!! one more doubt in excel activity
I need to do a calculation in 4 consecutive cells in a column.
by writing to each cell is a time consuming activity
Is there any other way???