get time between two rows, rows are not continuous.

FuNeS13

Board Regular
Joined
Oct 25, 2016
Messages
160
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
I have a spreadsheet that logs the start and finish of a task... I want to get the total time between the start and finish row, the thing is that the rows are not continuous, column A/B and F would be my triggers I guess as column A/B are the employee ID and Column F is the "Start/Finish" legend... the thing is that I have multiple employees filling this...

So lets say that I start my task as 07:01 AM by the time I finish, on 07:31 AM, n number of employees have also started tasks themselves... I have to get the total time for each task, for each employee... The trick is, the total time should be added to the "start" row...

Does this make any sense?

IDEmployee IDNameAreaWCTypeHourDateTime
51321587FuNeS1314602Start07:0110/07/20190:30:00
51311586Other124602Start07:0210/07/20190:07:00
51311586Other124602Finish07:0710/07/2019
51321587FuNeS1314602Finish07:3110/07/2019
51321587FuNeS1314602Start07:5010/07/2019(this is blank because I haven't finish the task yet)

<tbody>
</tbody>
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about


Book1
ABCDEFGHI
1IDEmployee IDNameAreaWCTypeHourDateTime
251321587FuNeS1314602Start07:0110/07/201900:30:00
351311586Other124602Start07:0210/07/201900:05:00
451311586Other124602Finish07:0710/07/2019
551321587FuNeS1314602Finish07:3110/07/2019
651321587FuNeS1314602Start07:5010/07/2019
Summary
Cell Formulas
RangeFormula
I2=IF(F2="start",IFERROR(INDEX($G2:$G$6,MATCH(A2&"|"&B2&"|Finish",INDEX($A2:$A$6&"|"&$B2:$B$6&"|"&$F2:$F$6,0),0))-G2,""),"")
 
Upvote 0
Slight variation ..

Excel Workbook
ABCDEFGHI
1IDEmployee IDNameAreaWCTypeHourDateTime
251321587FuNeS1314602Start7:017/10/20190:30:00
351311586Other124602Start7:027/10/20190:05:00
451311586Other124602Finish7:077/10/2019
551321587FuNeS1314602Finish7:317/10/2019
651321587FuNeS1314602Start7:507/10/2019
Task Time




BTW, Are tasks always finished on the same day they are started?
 
Last edited:
Upvote 0
Both answers are correct!!! Thank you both for your great help!!!


BTW, Are tasks always finished on the same day they are started?
^^^
Yes!
 
Last edited:
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
Both answers are correct!!! Thank you both for your great help!!!
You're welcome.


In that case, and *if* an employee always finishes one task before starting another, you could also use one of these shorter versions.

Excel Workbook
ABCDEFGHIJ
1IDEmployee IDNameAreaWCTypeHourDateTime
251321587FuNeS1314602Start7:017/10/201900:30:0000:30:00
351311586Other124602Start7:027/10/201900:05:0000:05:00
451311586Other124602Finish7:077/10/2019
551321587FuNeS1314602Finish7:317/10/2019
651321587FuNeS1314602Start7:507/10/2019
Task Time (2)
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top