Calculating hours between columns

exceluser9

Active Member
Joined
Jun 27, 2015
Messages
388
Hi Team,

I have below data and I would require a formula to see how many activity each person has processed in an hour, for every hour I would like to show the progress in different table. I want to see the progress for 12 hours. I input the processor name in column A in sheet 1 and 2 to get the results

Sheet 3
Column ACoulmn BColumn CColumn D
ProcessorActivityProcessed onMinutes
PeterCall12/03/2019 04:105
PeterChat12/03/2019 04:156
PeterChat12/03/2019 04:186
JamesIT issue12/03/2019 04:085
PaulChat12/03/2019 04:166
PeterCall12/03/2019 05:015
HelenChat12/03/2019 05:106
HarryIT issue12/03/2019 06:166
HarryTicket12/03/2019 07:164
HarryChat12/03/2019 08:166
HarryChat12/03/2019 08:166
HarryChat12/03/2019 09:166

<tbody>
</tbody>


Expected result sheet 1 only to count activity vs time
Column AColumn BColumn CColumn DColumn EColumn F
Processor4 PM to 5 PM5 PM to 6 PM7 PM to 8 PM8 PM to 9 PM9 PM to 10 PM
Peter31
James1
Paul1
Helen1
Harry1121

<tbody>
</tbody>


Also I would require one more formula to see how many minutes each person spent on the activity in each hour based on the minutes provided in minutes coulmn D

Expected result sheet 2, total time spent by processor on each activity for every hour
Column AColumn BColumn CColumn DColumn EColumn FColumn G
ProcessorActivity4 PM to 5 PM5 PM to 6 PM7 PM to 8 PM8 PM to 9 PM9 PM to 10 PM
PeterCall5
PeterChat12
JamesIT issue5
PaulChat6
PeterCall5
HelenChat6
HarryIT issue6
HarryChat12
HarryChat6

<tbody>
</tbody>


Thanks
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try this on for size:

Clip0022.jpg


Fill down and across the B17 and C23 formulas in their respective brackets.
 
Upvote 0
Hi Keweaver,

Thank you for response, im not able to copy formula since its in image.

Can you provide formula pls?
 
Upvote 0
Also original data is in sheet 3, will this look up into sheet 3?

And i want the formula to show the progress for 12 hour. Once is hourly basis and another once in 2 hours
 
Last edited:
Upvote 0
B7:
Code:
=SUMPRODUCT((--($A$2:$A$13=$A17))*(--(HOUR($C$2:$C$13)>=1*LEFT(B$16,1)))*(--(HOUR($C$2:$C$13)<1*1+LEFT(B$16,1))))

and filled...

C23:
Code:
=SUMPRODUCT((--($A$2:$A$13=$A24))*(--($B$2:$B$13=$B24))*(--(HOUR($C$2:$C$13)>=1*LEFT(C$23,1)))*(--(HOUR($C$2:$C$13)<1*1+LEFT(C$23,1)))*$D$2:$D$13)

and filled...

If the sheets vary, enter the sheet name(s) before the cell reference, e.g., Sheet1!$A24
 
Upvote 0
Hi Kweaver,

I have tried the code and it formula didnt work fine from 10 - 11, 11- 12, 12 - 1 properly

HarryIT issue12/03/2019 09:166
HarryTicket12/03/2019 10:164
HarryChat12/03/2019 11:166
HarryChat12/03/2019 12:166
HarryChat12/03/2019 12:166
HarryChat12/03/2019 12:166

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

Below are the results im getting

Processor9 - 1010 - 1111 - 1212 - 1
Peter0000
James0000
Paul0000
Helen0000
Harry1000

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

Could you help pls.

Thanks
 
Upvote 0
Sorry. That's because I cheated and assumed you were always starting with a single digit start hour. I haven't tested it on my sample, but suspect if you change the references to the "LEFT" function to 2 rather than 1 it should work.
BTW: note that a time such as 3 should be entered differently if you mean 3 AM vs PM. Then the testing has to be changed as well because 3 is AM and 3 PM would be represented by 15.

If I have a few minutes, I'll write that unless you feel OK doing it yourself.

B17, etc.:
Code:
=SUMPRODUCT((--($A$2:$A$13=$A17))*(--(HOUR($C$2:$C$13)>=1*LEFT(B$16,2)))*(--(HOUR($C$2:$C$13)<1*1+LEFT(B$16,2))))

C23, etc.:

Code:
=SUMPRODUCT((--($A$2:$A$13=$A24))*(--($B$2:$B$13=$B24))*(--(HOUR($C$2:$C$13)>=1*LEFT(C$23,2)))*(--(HOUR($C$2:$C$13)<1*1+LEFT(C$23,2)))*$D$2:$D$13)

I then made H23: 18 - 19 (for 6 PM - 7 PM)
and specifically adjusted the original date/time column C to have AM and PM distinctions.
 
Last edited:
Upvote 0
Thanks mate.

If I have a few minutes, I'll write that unless you feel OK doing it yourself.

Can you write this as well mate?

Thanks
 
Upvote 0
If I understood correct you want something like this?

ProcessorActivityProcessed onMinutesProcessorStart of HourEnd of HourCountProcessorActivityStart of HourEnd of HourCountMinutes
PeterCall
12/03/2019 04:10​
5​
Peter
04:00:00​
05:00:00​
3​
PeterCall
04:00:00​
05:00:00​
1​
5​
PeterChat
12/03/2019 04:15​
6​
James
04:00:00​
05:00:00​
1​
PeterChat
04:00:00​
05:00:00​
2​
12​
PeterChat
12/03/2019 04:18​
6​
Paul
04:00:00​
05:00:00​
1​
JamesIT issue
04:00:00​
05:00:00​
1​
5​
JamesIT issue
12/03/2019 04:08​
5​
Peter
05:00:00​
06:00:00​
1​
PaulChat
04:00:00​
05:00:00​
1​
6​
PaulChat
12/03/2019 04:16​
6​
Helen
05:00:00​
06:00:00​
1​
PeterCall
05:00:00​
06:00:00​
1​
5​
PeterCall
12/03/2019 05:01​
5​
Harry
06:00:00​
07:00:00​
1​
HelenChat
05:00:00​
06:00:00​
1​
6​
HelenChat
12/03/2019 05:10​
6​
Harry
07:00:00​
08:00:00​
1​
HarryIT issue
06:00:00​
07:00:00​
1​
6​
HarryIT issue
12/03/2019 06:16​
6​
Harry
08:00:00​
09:00:00​
2​
HarryTicket
07:00:00​
08:00:00​
1​
4​
HarryTicket
12/03/2019 07:16​
4​
Harry
09:00:00​
10:00:00​
1​
HarryChat
08:00:00​
09:00:00​
2​
12​
HarryChat
12/03/2019 08:16​
6​
HarryChat
09:00:00​
10:00:00​
1​
6​
HarryChat
12/03/2019 08:16​
6​
HarryChat
12/03/2019 09:16​
6​
 
Upvote 0
Hi Sandy,

Yes you are right and the the table which you gave looks amazing, could you share me the formula please?
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,299
Members
448,885
Latest member
LokiSonic

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