Count values based on condition in Excel

Dear Team,

I have below excel file, i would like to count no of “No” available in Column “Email Received”.
Please let me know how to do it.
ECOO Autoreport Status 2024.xlsx (33.6 KB)



Assign activity:
   Variable: countNo
   Value: YourDataTableVariable.AsEnumerable().Count(Function(row) row.Field(Of String)("Email Received").Equals("No"))

Hi @Amol_Golhar

Do you want to retrieve the count from all the sheets or from a specific sheet?


Hi @Amol_Golhar

Can you try below

Count = (From row In DT.AsEnumerable()
                             Where row.Field(Of String)("Email Received").ToUpper() = "NO"
                             Select row).Count()


Hi @Amol_Golhar

Check the below zip file:
Excel (187.6 KB)

The above code will print the count of No in Email Received column for the sheets present in the excel. Make sure to change the excel path to yours in Invoke Code Edit Arguments.


Hope it helps!!

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