How to count rows by excluding the first two rows?

I have an excel with a pivot table. For example: The pivot table starts at row 3, and there is information in the first row, then the next row is empty, and then row 3 is the headers for the pivot table. I want to count how many rows with information there is starting with row 4. How would I go about doing this? Right now I have a read range, row count, and write line.

1 Like


Just specify Range as “A3” in Read Range Activity and it will read data from A3 to till end. And then use below Expression to count no. of rows.


Small correction: probably the count should start at row A4 instead of row A3, as count is starting at row 4.

— use a excel application scope and pass the file path as input
— use a read range activity and get the output with a variable of type datatable named outdt and out the range as “A3” as the row starts from 3rd row and enable the property Add Headers
— use a assign activity and mention like this
Outdt_rows_count = outdt.AsEnumerable().Where(Function(x) x.ItemArray.Any(Function(a) Not string.IsNullOrEmpty(a.ToString))).ToArray().CopyToDatatable().Rows.Count.Tostring

This will give the count of rows which has the information without taking blank rows

Cheers @Mitchell_Binder

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