Can Auto Fill Range be used to get the sum of each column?

Good Day.

I have this datatable where I want to compute for the total of the following columns such as “Items Delivered”, “Amount”, and “Pending”.

I tried to use Auto Fill Range activity but it resulted into an error. What should be the proper syntax to get the sum of each column using Auto Fill Range activity?

Kindly see the picture for the desired output and file being used below. Thank you.


Test.xlsx (9.3 KB)

Best regards,
Robert Monsalud

Hey @Robert_Russell_Monsalud,

You can use the sum formula in the excel file.

First read the excel data into an datatable to get the row counts.

Using this expression in write cell activity.

"=SUM(B2:B"+(dt.Rows.Count+1).ToString+")"

image

And also to give cell number dynamic. Use below expression.

"B"+(dt.Rows.Count+2).ToString

image

Happy Automation,
Regards
Achal Sharma

1 Like

Does it mean that I won’t use Auto Fill Range anymore? Thank you.

Correct @Robert_Russell_Monsalud.

And if it is working for you then make it a solution. Thanks

1 Like

Thank you so much for the help.

Best regards,
Robert Monsalud

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