Count of a column in excel


I want to store the count of a column in excel in a variable, PFA screenshot for reference.

I want to store the count of column B (105) in a variable.

Thank you, let us double check. For better investigation, is it possible if you could send us the excel file? Also, What I have understood is you want the rows count of column B from your datatable, is that correct? Please confirm

Sample.xlsx (8.2 KB)

I have attached sample file.

Yes, I want to get the row count in column B, in the attached excel it will be count 3 (excluding header)

Sample.xlsx (8.5 KB)

And also, I want to get the count of rows which contain “posted” in column D

In the attached excel, the count will be 2 since posted occurs twice in column D. can you please assist me on how to achieve this?


Hi [Aishwarya Srinivasan]
You can follow these steps:

  • Open this file excel use activity Excel Application Scope
  • Use acvitity Excel Read Range, put range: “A1” and click check “Add Headers” → output to variable name is ArrExcelData
  • To count the desired number of rows by column B please use the following statement: Assign countTotalRow = ArrExcelData.Select("[request number] <> ‘’","").Count

Thank you, it worked :slight_smile:

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