How to check if there are rows meet my filter condition in Excel?

Dear Friends

I have a request as below:

IF the number in Column F [>2 or <-2], put a remak “Over gap” in column H

IF the number in Column F [>=-2 and <=2], put a remark “Released” in column H

I need to do it in Excel activityimage

I am thinking maybe I need to count the distinct number in Column F which meet the fileter condition or not, then I can take the next move

But I don’t know how to do it

Thank you for your kind guidance as always

Regards
Ivan

@yangyq10,

Use Activities - Find First/Last Data Row

This will help you with rows available.

Thanks,
Ashok :slight_smile:

Hi @yangyq10

You can try the below steps,
→ Take the Excel Process scope activity, inside of it insert the Use excel file activity and give the path of the file.
→ Inside Use excel file insert the for each excel row activity.
→ Inside for each activity insert the Else If activity and give the conditions,
→ In First else if give the condition as below,

Cint(CurrentRow(5).toString)>2 or Cint(CurrentRow(5).toString)<(-2)

→ Inside then block insert the write cell to write the Over gap in Column H.
→ In Second else if give the condition as below,

Cint(CurrentRow(5).toString)>=(-2) and Cint(CurrentRow(5).toString)<=2

→ Inside then block insert the write cell to write the Released in Column H.

Hope it helps!!

Thank you for the guidance

May I ask how to set row index for the rows which meet the condition?

For example this time row 5,6,7 meet the condition >2, but next time when I download another data, the rows which >2 may lay in row 1,3,7

we are using for each excel row activity if the rows will change no problem will occur based on condition it will write the text in Column H. I have given the workflow dynamically… @yangyq10

Hope you understand!!

Thank you for the patience
I don’t know why it keep pop up with error
Can you give me some hints?


image

Make a change as below, instead of using If activity, use the Else if activity.
In the 1st condition give the below one,

Cint(CurrentRow.ByIndex(5).toString)>2 or Cint(CurrentRow.ByIndex(5).toString)<(-2)

In the 2nd condition give the below one,

Cint(CurrentRow.ByIndex(5).toString)>=(-2) and Cint(CurrentRow.ByIndex(5).toString)<=2

Check the below image for better understanding,

Hope it helps!!

Thank you for staying with me
It works!!!

1 Like

It’s my pleasure… @yangyq10

Happy Automation!!

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