Excel cell comparision

hey i have two column in my excel sheet Name and Date. and my requirement is like thiks

  1. if same name and same date, row has three times then i just want keep only one row with name and date.

2.if same name and same date is one or two times then the row with name and date will be deleted.

mark 05/01/1991
mark 05/01/1991
mark 05/01/1991
Michael 06/02/1992
Michael 06/02/1992
John 07/02/1993

mark 05/01/1991


Rather than deleting row i would just create a new table to add the row which satisfy a certain condiation (in your case three or more time the same row value on both columns).

inside a For Each Row you can add a If with a conditation such as this one :
dt.Select(β€œ[Name]='” & row(β€œName”).ToString & β€œβ€™ And [Bdate]='” & row(β€œBdate”).ToString & β€œ'”).Count >=3

If true you will need to add a row to your new table (Using ArrayRow as input since the current still belong to the table you are looping in.

At the end of the iteration, the second table where you add row will only contain rows with 3 or more than 3 occurrences. you then just have to remove duplicate.

Assign activity with : NewDt = newDT.DefaultView.ToTable(True) should do the trick.

I’m attaching you a workflow, let me know if you have any issue.

Monday.xaml (11.0 KB)

1 Like