ARahman
(Md. Abdur Rahman)
December 3, 2019, 12:57pm
1
Hi,
I’m trying to automated calculation in Excel that is Mark Calculation. Anyone can present a suitable process for dynamically calculation row wise.

Actually, recently I completed individual process by hardcore in process task. Please check my excel and automation file…

My Expectation is -
B2+C2= Total Value
B3+C3= Total Value
B4+C4= Total Value… but how to dynamically not hard coded or fixed cell value.

Deepak94
(Deepak Kolge)
December 3, 2019, 1:21pm
2
Hi @ARahman ,
You can try it as below.

Read the entire excel file using workbook ReadRange → output would be dtExcelRead
Take int i=2
while i<=dtExcelRead.row.count
writeCell Activity → Range should be : “D”+i.ToString
→ Value should be : =sum(“B”+i.ToString+“:”+“C”+i.ToString)
i=i+1
It will print the formula and generate the sum.
Hope this will work for you.
Thanks!

1 Like

TimK
(Tim Kok)
December 3, 2019, 1:22pm
3
so you can enter formulas directly into excel

you can use a write cell activity and write directly into column D

firstly use read range to read datatable
then determine your last row intRows = (dt.Rows.Count)

In write cell you can write in formula:
“=sum(B2:C2)”
in your range write:
“D2:C”+intRows.ToString

1 Like

ARahman
(Md. Abdur Rahman)
December 3, 2019, 1:42pm
4
@Deepak94 … How to assign i=2, Can you show my project

Excel_Data_Save.zip (20.7 KB)

Deepak94
(Deepak Kolge)
December 3, 2019, 2:05pm
5
Hi @ARahman ,
You can simply create a new int variable and name it as “i”.
then you have to assign i=2 before while loop.

Thanks!

2 Likes

HareeshMR
(Hareesh Madasi)
December 3, 2019, 2:38pm
6
You don’t need to loop @ARahman . Use write cell activity to pass the formula for one row (may be the second row) and then use auto fill range activity which will write the data in all the rows of the excel upto whatever rows you have data in excel

2 Likes

ARahman
(Md. Abdur Rahman)
December 4, 2019, 4:31am
7
Hi @HareeshMR … Can you explain it more description. Or please correction in my workflow that i attached before.

ARahman
(Md. Abdur Rahman)
December 4, 2019, 12:11pm
9
Thanks @HareeshMR . The Problem has been Solved as follow your Steps.

2 Likes

system
(system)
Closed
December 7, 2019, 12:24pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.