Excel condition14

Hi

Hope the below steps would help you resolve this

  1. First use a read range activity and get the output as datatable dt

  2. Let’s find the number of rows in C and D column individually

Int_crows = (From row in dt.AsEnumerable() Select Convert.Tostring(row(“C-ColumnName”))).ToList().Count

Mention C column name of your table

Similarly for D column

Int_drows = (From row in dt.AsEnumerable() Select Convert.Tostring(row(“D-ColumnName”))).ToList().Count

Where int_crows and int_drows are int32 type of variable

  1. Now use a IF condition like this

int_crows.Equals(int_drows)

If true it will go to THEH block where leave it empty and if false go to ELSE where use the below set of assign activity

dt.Rows(dt.Rows.Count)(“credit amount”) = “0”

Another assign activity

dt.Rows(dt.Rows.Count)(“Debit account”) = “0”

Cheers @HeartCatcher

2 Likes