I have 1 excel having some column names A B C D
I need the count of empty rows
(condition : column A must have data and D is empty then count no of empty rows of D column)
Can anyone help me here…
Loop through it
Set counter = 0
if row(“D”)is null or empty using a series of if statement for each condition.
If each cell is empty, then add 1 to counter
Then write it
better to tell, what exactly is not working
Maybe the data has some spaces and would require a trim before checking
myCount | int32 =
(From d in YourDataTableVar.AsEnumerable Where Not ( isNothing(d("ColA")) OrElse String.IsNullOrEmpty(d("ColA").toString.Trim) ) Where isNothing(d("ColD")) OrElse String.IsNullOrEmpty(d("ColD").toString.Trim) Select r=d).Count
Hi @ppr ,
thank you, but I got below error could you please suggest me here
thanks in advance
we do feel that your statement differs from ours.
->(From…) ← .Count
Just recheck and correct
You can achieve this by using the following steps:
- Read the Excel file into a DataTable using the Read Range activity.
- Initialize a variable to keep count of the empty rows. Let’s call it
emptyRowCountand set it to 0.
- Iterate through each row in the DataTable.
- For each row, check if Column A is not empty and Column D is empty. If both conditions are met, increment
- After processing all rows,
emptyRowCountwill contain the count of empty rows where Column A has data, and Column D is empty.
thank you so much @ppr
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.