Excel column Count

There is excel file i want to count no. of P(OD) in that ROW…
the row no. is 14…

Status P(OD) P(OD) P(OD) P(OD) WO P(OD) P(OD) P(OD) P(OD) P(OD) P(OD) WO P(OD) P(OD) P(OD) P(OD) P(OD) P(OD) WO P(OD) P(OD) P(OD) P(OD) P(OD) P(OD) WO P(OD) P(OD) P(OD) P(OD)Monthly_DetailedReportForEmployee.xls (11.5 KB)

1.) Create a variable to hold the count and initialize it at 0.
2.) Extract the data from row 14 using the Read Range activity.
3.) Create a For Each activity to iterate over DtTable.Columns, where DtTable is the datatable you extracted in step 1.
4.) Create an If activity with condition DtTable.Rows(0)(item.ToString).ToString = "P(OD)", where item is the item variable iterated on in the loop.
5.) If the statement is true, increment the count variable created in step 1 using an Assign activity.

In read range what i can Put??
Put the range of 14 No. Row???Salary Days.xaml (6.4 KB)

You can achieve it easily with the help of Linq query

  1. Extract the Status Row -
    row_statusRow = ((From row In dt_emp_data.AsEnumerable Where row.Item(0).Equals("Status") Select row)(0))
  2. Convert Status Row in Item Array -
    This will return all row items in form of an array.
  3. Keep P(OD) and filter the rest out.
    (from item in row_StatusRow.ItemArray where item.Equals("P(OD)") select item).Count
    In above query we are only keeping P(OD) entries and removing rest. At very end we are also extracting count of the array.

Here is the workflow for reference.
Main.xaml (7.7 KB)

How i want to compare Current column with Previous and next Column…

If last column contain WO then…Other condition…
But How go to Last Column…
I use
Next Col= dt.columns.indexof(item.tostring)
But it show index no. I want contain of that index…

or any other solution…

Can you please explain exactly what your target is?? As from original post I can tell that you only want to extract number of P(OD) in a given row.

Regarding this - Next Col= dt.columns.indexof(item.tostring)
This is working fine, if you want to get the value of the previous column then do this -
Next_col_idx = dt.columns.indexof(item.tostring) + 1
Next_col_value = dt.row(row_idx).item(next_col_idx)