Calculation of working hours from in time and out time

New Microsoft Office Excel Worksheet.xlsx (9.3 KB)

Can anyone plz suggest me the way to calculate the working hours from intime and outtime and get the total working hours in a variable.

Hi @vidhan.rpa,

can you please give a more clear view about the requirement


Yes, you have to read the intime & outtime column values from the excel and at the end get the total working hours based on daily working hours.

So for 9 and 6 do you want total in 15, something like this ?

you have to get the daily working hours and take the total 30 days working hours based on daily hours

Hi @vidhan.rpa

Use read range to read the excel ( check preserve format option) and store in dt1

Use for each row to loop through each row in dt1

use the below assign activitiy like this

DateTime.ParseExtract(row(“outtime”).ToString,“hh:mm”, System.Globalization.CultureInfo.InvariantCulture) - DateTime.ParseExtract(row(“intime”).ToString,“hh:mm”, System.Globalization.CultureInfo.InvariantCulture)

Then write the total_time into excel using write cell activitiy

can you plz create a workflow, bcoz it is not working for me.

Can u show the error which u are facing while creating the workflow ?