Number of staff in building - date/time issues

khutchy

New Member
Joined
Feb 25, 2013
Messages
4
Hi
I have data showing when staff arrive at, enter after clearing security and then exit a building after completing their task. The data for each cell is a combined date and time as opposed to separate cells for date and time.
I am trying to ascertain how long our security staff take to clear persons waiting to enter the building and also how many people at any one time are actually in the building (after being processed through security).
I also need to ascertain if particular issues arise at certain days of the week (eg Mon morning) and so need to add a further column which shows the day of week using the date/time data.

A sample of the data is as follows;

[TABLE="width: 470"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Staff No:[/TD]
[TD]Arrival time[/TD]
[TD]Processed time[/TD]
[TD]Exit time[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]26/02/2013 07:13[/TD]
[TD]26/02/2013 07:22[/TD]
[TD]26/02/2013 13:52[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]26/02/2013 07:25[/TD]
[TD]26/02/2013 07:36[/TD]
[TD]26/02/2013 14:12[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]26/02/2013 07:36[/TD]
[TD]26/02/2013 07:54[/TD]
[TD]26/02/2013 16:41[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]26/02/2013 07:41[/TD]
[TD]26/02/2013 08:01[/TD]
[TD]26/02/2013 19:18[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]26/02/2013 08:06[/TD]
[TD]26/02/2013 08:13[/TD]
[TD]26/02/2013 18:45[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]27/02/2013 07:13[/TD]
[TD]27/02/2013 07:22[/TD]
[TD]27/02/2013 21:52[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]27/02/2013 07:25[/TD]
[TD]27/02/2013 08:06[/TD]
[TD]27/02/2013 14:12[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]27/02/2013 07:36[/TD]
[TD]27/02/2013 07:54[/TD]
[TD]27/02/2013 16:41[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]27/02/2013 07:41[/TD]
[TD]27/02/2013 08:01[/TD]
[TD]27/02/2013 19:18[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]28/02/2013 08:06[/TD]
[TD]28/02/2013 08:13[/TD]
[TD]28/02/2013 18:45[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]28/02/2013 07:13[/TD]
[TD]28/02/2013 07:22[/TD]
[TD]28/02/2013 22:52[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]28/02/2013 07:25[/TD]
[TD]28/02/2013 07:36[/TD]
[TD]28/02/2013 14:12[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]28/02/2013 07:36[/TD]
[TD]28/02/2013 07:54[/TD]
[TD]28/02/2013 16:41[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]28/02/2013 07:41[/TD]
[TD]28/02/2013 08:01[/TD]
[TD]28/02/2013 20:18[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]28/02/2013 08:06[/TD]
[TD]28/02/2013 08:13[/TD]
[TD]28/02/2013 21:45[/TD]
[/TR]
</tbody>[/TABLE]

I had thought about trying to display the data using a a stacked bar chart but I still need to look at any particular date/time and ascertain how many persons are in the building without manually counting the rows!

Any help appreciated
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Perhaps this will give you some ideas.
Excel Workbook
ABCDEFGHIJ
1Clear timeTime of dayPeople in building
2Staff No:Arrival timeProcessed timeExit time26/02/201327/02/201328/02/2013Average (rounded up)
3126/02/2013 07:1326/02/2013 07:2226/02/2013 13:520:09:0007:000000
4226/02/2013 07:2526/02/2013 07:3626/02/2013 14:120:11:0008:003233
5326/02/2013 07:3626/02/2013 07:5426/02/2013 16:410:18:0009:005465
6426/02/2013 07:4126/02/2013 08:0126/02/2013 19:180:20:0010:005465
7526/02/2013 08:0626/02/2013 08:1326/02/2013 18:450:07:0011:005465
8627/02/2013 07:1327/02/2013 07:2227/02/2013 21:520:09:0012:005465
9727/02/2013 07:2527/02/2013 08:0627/02/2013 14:120:41:0013:005465
10827/02/2013 07:3627/02/2013 07:5427/02/2013 16:410:18:0014:004465
11927/02/2013 07:4127/02/2013 08:0127/02/2013 19:180:20:0015:003354
121028/02/2013 08:0628/02/2013 08:1328/02/2013 18:450:07:0016:003354
131128/02/2013 07:1328/02/2013 07:2228/02/2013 22:520:09:0017:002243
141228/02/2013 07:2528/02/2013 07:3628/02/2013 14:120:11:0018:002243
151328/02/2013 07:3628/02/2013 07:5428/02/2013 16:410:18:0019:001232
161428/02/2013 07:4128/02/2013 08:0128/02/2013 20:180:20:0020:000132
171528/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0021:000121
1822:000011
Sheet1
 
Upvote 0
Mark

This is excellent and nearly sorts all the query.

Is it possible to show the average number of persons in the building (J column) separately for each day of the week (Mon-Fri). Appreciate the sample data set was only for 3 days, but we operate 7 days and I am trying to ascertain trends on each day of the week over a 3 month period

Much appreciated

Keith
 
Upvote 0
Please note that the formula in Column K must be entered with Ctrl-Shift-Enter not just enter (do not put in the curly brackets manually)
Excel Workbook
ABCDEFGHIJK
1Clear timeTime of dayPeople in building
2TueWedTue
3Staff No:Arrival timeProcessed timeExit time26/02/201327/02/201305/03/2013DayDay Av
4126/02/2013 07:1326/02/2013 07:2226/02/2013 13:520:09:0007:00000Tue3
5226/02/2013 07:2526/02/2013 07:3626/02/2013 14:120:11:0008:00323Wed2.5
6326/02/2013 07:3626/02/2013 07:5426/02/2013 16:410:18:0009:00545
7426/02/2013 07:4126/02/2013 08:0126/02/2013 19:180:20:0010:00545
8526/02/2013 08:0626/02/2013 08:1326/02/2013 18:450:07:0011:00545
9627/02/2013 07:1327/02/2013 07:2227/02/2013 21:520:09:0012:00545
10727/02/2013 07:2527/02/2013 08:0627/02/2013 14:120:41:0013:00545
11827/02/2013 07:3627/02/2013 07:5427/02/2013 16:410:18:0014:00445
12927/02/2013 07:4127/02/2013 08:0127/02/2013 19:180:20:0015:00334
131005/03/2013 00:0005/03/2013 08:1305/03/2013 18:458:13:0016:00334
141105/03/2013 07:1305/03/2013 07:2205/03/2013 22:520:09:0017:00223
151205/03/2013 07:2505/03/2013 07:3605/03/2013 14:120:11:0018:00223
161305/03/2013 07:3605/03/2013 07:5405/03/2013 16:410:18:0019:00122
171405/03/2013 07:4105/03/2013 08:0105/03/2013 20:180:20:0020:00012
181528/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0021:00011
1922:00001
Sheet1
 
Upvote 0
Mark

Many thanks thus far. I didnt outline the reply very well. What I was trying to do with the average people in building was show it broken down by day / hour as below


[TABLE="width: 523"]
<colgroup><col><col span="7"></colgroup><tbody>[TR]
[TD] [/TD]
[TD="colspan: 7"]Avg numbers in building[/TD]
[/TR]
[TR]
[TD]Time of day[/TD]
[TD]Mon[/TD]
[TD]Tue[/TD]
[TD]Wed[/TD]
[TD]Thu[/TD]
[TD]Fri[/TD]
[TD]Sat[/TD]
[TD]Sun[/TD]
[/TR]
[TR]
[TD]07:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]08:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]09:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]10:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]11:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]12:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]13:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]14:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]15:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]16:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]17:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]18:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]19:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]20:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]21:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]22:00[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]

I tried to vary the formula above in K4
K4{=AVERAGE(IF($G$2:$I$2=J4,$G$4:$I$19))}

<tbody>
</tbody>
But when I vary it to try to obtain the avg numbers on Tues at 0800hrs I am getting the total (6) divided by all the days in the row (x2 Tue and 1 Wed) instead of just the x2 Tues.

K
 
Upvote 0
Excel Workbook
ABCDEFGHIJKL
1Clear timeTime of dayPeople in building
2TueThuTue
3Staff No:Arrival timeProcessed timeExit time26/02/201328/02/201305/03/2013TimeTueThu
4119/02/2013 07:1319/02/2013 07:2219/02/2013 13:520:09:0007:0000007:0000
5219/02/2013 07:2519/02/2013 07:3619/02/2013 14:120:11:0008:0020108:001.50
6319/02/2013 07:3619/02/2013 07:5419/02/2013 16:410:18:0009:0044209:0034
7419/02/2013 07:4119/02/2013 08:0119/02/2013 19:180:20:0010:0044210:0034
8519/02/2013 08:0619/02/2013 08:1319/02/2013 18:450:07:0011:0044211:0034
9626/02/2013 07:1326/02/2013 07:2226/02/2013 21:520:09:0012:0044212:0034
10726/02/2013 07:2526/02/2013 08:0626/02/2013 14:120:41:0013:0044213:0034
11826/02/2013 07:3626/02/2013 07:5426/02/2013 16:410:18:0014:0044214:0034
12926/02/2013 07:4126/02/2013 08:0126/02/2013 19:180:20:0015:0034215:002.54
131005/03/2013 00:0005/03/2013 08:1305/03/2013 18:458:13:0016:00342
141105/03/2013 07:1305/03/2013 07:2205/03/2013 22:520:09:0017:00242
151228/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0018:00242
161328/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0019:00241
171428/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0020:00141
181528/02/2013 08:0628/02/2013 08:1328/02/2013 21:450:07:0021:00141
1922:00001
Sheet3
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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