How to get count of empty columns in the excel

Hi Everyone,
I have excel with some columns
column a having data
column C some rows having data

how to find count of empty rows of c(condition: column a having data and and column c having empty rows)

Thanks

1 Like

@panguluri_saritha Hope below code helps you.

Assign int_Variable = your_dt.AsEnumerable().Where(Function(row) Not row.IsNull(“ColumnA”) AndAlso String.IsNullOrWhiteSpace(row(“ColumnC”).ToString())).Count()

Hi,
Try this
emptyRowCount = YourDataTable.AsEnumerable().Where(Function(row) Not String.IsNullOrEmpty(row.Field(Of String)(“ColumnA”)) AndAlso String.IsNullOrEmpty(row.Field(Of String)(“ColumnC”))).Count()

2 Likes