How to sum up times in an excel, taking the last cell with time as dynamic

Hi @Neha_Kumari1

variable time is GenericValue, we need to convert that to TimeSpan type and then use .Add() method to add the time

more details

after Format value activity

  • create a variable of System.TimeSpan type, lets say TempTime
  • assign TempTime = TimeSpan.Parse(time) this converts the GenericValue of time to TimeSpan type
  • create another variable lets say total_time of TimeSpan type, assing value 0 before the For Each Row. Now within the for loop assing total_time = total_time.Add(TempTime) this will add all the times in the excel

Hope this helps. If this answers you please mark as solution so it helps others with similar doubt

1 Like