Go to the end of a row in Excel and execute a function

I want to execute a function in excel based on a row count. Something like =COUNTA(E2:E819)/ROWS(E2:E819) – each time the column will be the same but the row will be different. What is the best way to approach this? Is this easier as a macro executed by the robot or something I should do inside of UiPath?

If you want to get the count of rows in the excel after storing in a datatable, you can get it by using datatable.rows.count and assign to a variable as rowCount

Then you can give the above expression as
“=count(E2:E” + rowCount.tostring + “)/(rows(E2:E” + rowCount.tostring + “)”

All these can be done in the UiPath itself :slight_smile:

ah ok - thanks - I’ll try it.

Hi @DougGowans
In addition to the previous post -
Make sure that row count is greater than one and also in the read range if you checked the option “Include Headers”, then add +1 to the row count. Because your data table ignores the header row.

Regards,
Karthik Byggari

1 Like