Running a loop inside excel to sheet to find values in certain cells

Hi, I wanted to know if there’s a way to run a loop in an excel sheet that if the value exists in a cell certain column then return the value otherwise ignore the empty cells between.

For example, if there can be a value inside A1 then the value may exist in A15(in this case return the value of both these cells). But the cells are empty between A2 to A14.

Thanks

Read Range into a datatable, then do your value analysis in the datatable.

Hi @Nikhil_Kashyap1,

Use the read range activity and extract it to the table, then delete the rows that you do not want or that are empty with the filter activity.

Can you share excel to understand your expectation more clearly?

Regards,
MY

Actually, In an ongoing loop, I wanted to keep those rows empty in order to switch the workflow when there’s a value in the certain cell.

you may want to try using the lookup excel activity. This will return a true or false if a value is found in the range you specify

Hello @Nikhil_Kashyap1

I would be more clear if you explain your requirement with a screenshot of any 2 sample excels and the expected output.

Screenshot 2022-06-28 213141

So, What I want is in column F every time there’s a value I want to change the ID (while keeping the empty rows)meanwhile the loop is constant in column G.

Read Range into a data table, use for each row activity and check if 6th column (F column) is empty or not, if not empty, update 7th column value with column 6.
Eg: If : not String.isnullorempty(currentRow.item(5).tostring)
currentrow.item(6) = currentrow.item(5).tostring

And write back the data table to Excel at end