# Excel: How do you calculate sum dynamica

Hi,

I have an Excel with 2 sheets. How do you calculate sum of all values in a column say “Sales” without ‘Save for later’ activity in StudioX ? I need it for both sheets. The column has values from E2 to E12 in sheet 1 and from E2 to E34 in sheet2. I want to write sum in E13 and E35 respectively.
I do ‘First/Last data row’ to find first (2) and last row number(12) in sheet1 for sum and put sum in a cell (E13) but I want to avoid ‘Save for later’ activity.
Is there a way out to work dynamically ?

Hi @Prinal_C - your question was not clear…you are already using `First/Last data row` activity and from that writing the output in E13 dynamically right?

You can share a screenshot , it would help us in understanding your query better…

1 Like

@prasath17 Here are the screenshorts of the Excel. I want to write the sum in Cell E13 of Sheet1 and Cell E35 of Sheet2. First/Last Data row will give me (e.g. 2 and 12) of sheet 1 values as two variables (say first=2 and last =12). I have to write the sum in 13th row i.e. E13. I have to increament the count of last by 1 to get 13 and then write it in cell E13. I do not want to use Assign to increase the count. How do I get the sum in E13 and then in E35 ?

@Prinal_C - So you can use the Write cell activity and say “E” + (Last Data Row + 1) …right??

I know you do not want “Save for Later” activity which is available only in 20.6(i saw your other post ) but you can utilize the “save for later use” in First/Last data row and use that value in the Write cell…it will work definitely and it is dynamic…

@Prinal_C - You can try like this…

My Output

Hope this helps…

Note: Use Excel File is my first activity…

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