Computing the total number of certain rows in a excel file then copy and paste them into another excel file

Sample 1.xlsx (19.7 KB) Sample 2.xlsx (9.6 KB)

In this scenario, I want to get the total number of Regular Hours and the total number of OT Hours for a “Rest Day” Day Type in Sample 1 Excel file. Then, the total number of Regular Hours and the total number of OT Hours for a “Rest Day” Day Type will be pasted on its assigned cell in the Sample 2 Excel file. How can I do this? Thank you for the help.

Hi @ROBERT_RUSSELL_MONSA,

  • Use Filter Wizard Activity to Filter Rest Day
  • Create Two Integer Variables, TotalRegularHours = 0, TotalRestHours = 0.
  • Make a For Each Row activity with filteredDT, inside the body do the following
    - TotalRegularHours = TotalRegularHours + Convert.ToInt32(row(1).ToString)
    - TotalRestHours= TotalRegularHours + Convert.ToInt32(row(2).ToString)
  • Use Write Cell activity to write the outputs.
1 Like

Can I see a sample?

Hi @ROBERT_RUSSELL_MONSA,

Please find the sample,

1 Like