get time between two rows, rows are not continuous.

FuNeS13

Board Regular
Joined
Oct 25, 2016
Messages
161
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?

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Employee ID[/TD]
[TD]Name[/TD]
[TD]Area[/TD]
[TD]WC[/TD]
[TD]Type[/TD]
[TD]Hour[/TD]
[TD]Date[/TD]
[TD]Time[/TD]
[/TR]
[TR]
[TD]5132[/TD]
[TD]1587[/TD]
[TD]FuNeS13[/TD]
[TD]1[/TD]
[TD]4602[/TD]
[TD]Start[/TD]
[TD]07:01[/TD]
[TD]10/07/2019[/TD]
[TD]0:30:00[/TD]
[/TR]
[TR]
[TD]5131[/TD]
[TD]1586[/TD]
[TD]Other1[/TD]
[TD]2[/TD]
[TD]4602[/TD]
[TD]Start[/TD]
[TD]07:02[/TD]
[TD]10/07/2019[/TD]
[TD]0:07:00[/TD]
[/TR]
[TR]
[TD]5131[/TD]
[TD]1586[/TD]
[TD]Other1[/TD]
[TD]2[/TD]
[TD]4602[/TD]
[TD]Finish[/TD]
[TD]07:07[/TD]
[TD]10/07/2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5132[/TD]
[TD]1587[/TD]
[TD]FuNeS13[/TD]
[TD]1[/TD]
[TD]4602[/TD]
[TD]Finish[/TD]
[TD]07:31[/TD]
[TD]10/07/2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5132[/TD]
[TD]1587[/TD]
[TD]FuNeS13[/TD]
[TD]1[/TD]
[TD]4602[/TD]
[TD]Start[/TD]
[TD]07:50[/TD]
[TD]10/07/2019[/TD]
[TD](this is blank because I haven't finish the task yet)[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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