Time sheet calculations Excel 2013

polarnavs

New Member
Joined
Feb 22, 2014
Messages
46
So I have a spreadsheet that I need to:

sum time for the week for the agent
sum time for the day of the week
count the number of agents that are scheduled during each half hour

[TABLE="width: 738"]
<colgroup><col><col span="8"><col></colgroup><tbody>[TR]
[TD]Agent[/TD]
[TD]Agent ID[/TD]
[TD] Mon[/TD]
[TD]Tue[/TD]
[TD]Wed[/TD]
[TD]Thu[/TD]
[TD]Fri[/TD]
[TD]Sat[/TD]
[TD]Sun[/TD]
[TD]Total Hours[/TD]
[/TR]
[TR]
[TD]Jones, Charles[/TD]
[TD="align: right"]1849 [/TD]
[TD] OFF[/TD]
[TD]9a-5p[/TD]
[TD]9a-5p[/TD]
[TD]10a-6p[/TD]
[TD]7a-3p[/TD]
[TD]8a-4p[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Smith, Karen[/TD]
[TD="align: right"]1987[/TD]
[TD] 11P-7a[/TD]
[TD]10P-6a[/TD]
[TD]10p-6a[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]3p-11p[/TD]
[TD]3p-11p[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Bulfeeney, Mike[/TD]
[TD="align: right"]1876 [/TD]
[TD]4p-9p[/TD]
[TD]9p-3a[/TD]
[TD]2p-10p[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]1a-8a[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Edwards, Karl[/TD]
[TD="align: right"]2098[/TD]
[TD] 6p-2a[/TD]
[TD]1a-9a[/TD]
[TD]5a-12p[/TD]
[TD]9a-5p[/TD]
[TD]9a-4p[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Sanderson, Al[/TD]
[TD="align: right"]2187[/TD]
[TD] OFF[/TD]
[TD]9a-5p[/TD]
[TD]9a-5p[/TD]
[TD]10a-6p[/TD]
[TD]7a-3p[/TD]
[TD]8a-4p[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Kennedy, Sherry[/TD]
[TD="align: right"]2287 [/TD]
[TD]11P-7a[/TD]
[TD]5a-12p[/TD]
[TD]1a-9a[/TD]
[TD]8a-4p[/TD]
[TD]OFF[/TD]
[TD]10a-6p[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Totals[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]

I've done text to columns but can't get the split up cells to format to hours.
And I don't even know where to start on the calculation of how many agents scheduled for each half hour.
 
[TABLE="width: 1294"]
<tbody>[TR]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"]text to column[/TD]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 184, bgcolor: white"]format-- > h:mm[/TD]
[TD="width: 6, bgcolor: white"][/TD]
[TD="width: 1230, bgcolor: transparent"]formula[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C4,RIGHT(C4,1)," "&RIGHT(C4,1)))-TIMEVALUE(SUBSTITUTE(B4,RIGHT(B4,1)," "&RIGHT(B4,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]10P-6a[/TD]
[TD="width: 101, bgcolor: white"]10P[/TD]
[TD="bgcolor: transparent"]6a[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C5,RIGHT(C5,1)," "&RIGHT(C5,1)))-TIMEVALUE(SUBSTITUTE(B5,RIGHT(B5,1)," "&RIGHT(B5,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9p-3a[/TD]
[TD="width: 101, bgcolor: white"]9p[/TD]
[TD="bgcolor: transparent"]3a[/TD]
[TD="bgcolor: transparent, align: right"]6:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C6,RIGHT(C6,1)," "&RIGHT(C6,1)))-TIMEVALUE(SUBSTITUTE(B6,RIGHT(B6,1)," "&RIGHT(B6,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]1a-9a[/TD]
[TD="width: 101, bgcolor: white"]1a[/TD]
[TD="bgcolor: transparent"]9a[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C7,RIGHT(C7,1)," "&RIGHT(C7,1)))-TIMEVALUE(SUBSTITUTE(B7,RIGHT(B7,1)," "&RIGHT(B7,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C8,RIGHT(C8,1)," "&RIGHT(C8,1)))-TIMEVALUE(SUBSTITUTE(B8,RIGHT(B8,1)," "&RIGHT(B8,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]5a-12p[/TD]
[TD="width: 101, bgcolor: white"]5a[/TD]
[TD="bgcolor: transparent"]12p[/TD]
[TD="bgcolor: transparent, align: right"]7:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C9,RIGHT(C9,1)," "&RIGHT(C9,1)))-TIMEVALUE(SUBSTITUTE(B9,RIGHT(B9,1)," "&RIGHT(B9,1))),1)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Total[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]21:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=SUM(D4:D9)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
[TABLE="width: 1294"]
<colgroup><col width="101" style="width: 76pt; mso-width-source: userset; mso-width-alt: 3693;" span="3"> <col width="184" style="width: 138pt; mso-width-source: userset; mso-width-alt: 6729;"> <col width="6" style="width: 5pt; mso-width-source: userset; mso-width-alt: 219;"> <col width="1230" style="width: 923pt; mso-width-source: userset; mso-width-alt: 44982;"> <tbody>[TR]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"]text to column[/TD]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 184, bgcolor: white"]format-- > h:mm[/TD]
[TD="width: 6, bgcolor: white"] [/TD]
[TD="width: 1230, bgcolor: transparent"]formula[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C4,RIGHT(C4,1)," "&RIGHT(C4,1)))-TIMEVALUE(SUBSTITUTE(B4,RIGHT(B4,1)," "&RIGHT(B4,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]10P-6a[/TD]
[TD="width: 101, bgcolor: white"]10P[/TD]
[TD="bgcolor: transparent"]6a[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C5,RIGHT(C5,1)," "&RIGHT(C5,1)))-TIMEVALUE(SUBSTITUTE(B5,RIGHT(B5,1)," "&RIGHT(B5,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9p-3a[/TD]
[TD="width: 101, bgcolor: white"]9p[/TD]
[TD="bgcolor: transparent"]3a[/TD]
[TD="bgcolor: transparent, align: right"]6:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C6,RIGHT(C6,1)," "&RIGHT(C6,1)))-TIMEVALUE(SUBSTITUTE(B6,RIGHT(B6,1)," "&RIGHT(B6,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]1a-9a[/TD]
[TD="width: 101, bgcolor: white"]1a[/TD]
[TD="bgcolor: transparent"]9a[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C7,RIGHT(C7,1)," "&RIGHT(C7,1)))-TIMEVALUE(SUBSTITUTE(B7,RIGHT(B7,1)," "&RIGHT(B7,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent, align: right"]8:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C8,RIGHT(C8,1)," "&RIGHT(C8,1)))-TIMEVALUE(SUBSTITUTE(B8,RIGHT(B8,1)," "&RIGHT(B8,1))),1)[/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]5a-12p[/TD]
[TD="width: 101, bgcolor: white"]5a[/TD]
[TD="bgcolor: transparent"]12p[/TD]
[TD="bgcolor: transparent, align: right"]7:00[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=MOD(TIMEVALUE(SUBSTITUTE(C9,RIGHT(C9,1)," "&RIGHT(C9,1)))-TIMEVALUE(SUBSTITUTE(B9,RIGHT(B9,1)," "&RIGHT(B9,1))),1)[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"] [/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Total[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]45[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=SUM(D4:D9)*24[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
[TABLE="width: 989"]
<colgroup><col width="101" style="width: 76pt; mso-width-source: userset; mso-width-alt: 3693;" span="3"> <col width="1015" style="width: 761pt; mso-width-source: userset; mso-width-alt: 37120;"> <tbody>[TR]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"]text to column[/TD]
[TD="width: 101, bgcolor: transparent"][/TD]
[TD="width: 1015, bgcolor: transparent"]another approach[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="width: 101, bgcolor: white"]Tue[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]10P-6a[/TD]
[TD="width: 101, bgcolor: white"]10P[/TD]
[TD="bgcolor: transparent"]6a[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9p-3a[/TD]
[TD="width: 101, bgcolor: white"]9p[/TD]
[TD="bgcolor: transparent"]3a[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]1a-9a[/TD]
[TD="width: 101, bgcolor: white"]1a[/TD]
[TD="bgcolor: transparent"]9a[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]9a-5p[/TD]
[TD="width: 101, bgcolor: white"]9a[/TD]
[TD="bgcolor: transparent"]5p[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]5a-12p[/TD]
[TD="width: 101, bgcolor: white"]5a[/TD]
[TD="bgcolor: transparent"]12p[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="width: 101, bgcolor: white"] [/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 101, bgcolor: white"]Total[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]One formula per day for all agents[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]45[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]=SUMPRODUCT(MOD(--SUBSTITUTE(C4:C9,RIGHT(C4:C9,1)," "&RIGHT(C4:C9,1))---SUBSTITUTE(B4:B9,RIGHT(B4:B9,1)," "&RIGHT(B4:B9,1)),1))*24[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
First part is a huge help. Any idea on how to count the agents scheduled during a particular half hour.

12:00A - 12:30 A 3
12:30A - 1:00A 2

and so on
 
Upvote 0
Can I add an IFERROR to this to get a 0 for #VALUE issues

[TABLE="width: 416"]
<colgroup><col width="554" style="width: 416pt; mso-width-source: userset; mso-width-alt: 20260;"> <tbody>[TR]
[TD="width: 554, bgcolor: transparent"]If error will not work, replace off with zero's in both cells.[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
=iferror(mod(timevalue(substitute(m2,right(m2,1)," "&right(m2,1)))-timevalue(substitute(l2,right(l2,1)," "&right(l2,1))),1),0)
 
Upvote 0

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