VLOOKUP (or Equivelent) based on TIME (HH:MM)

KSingh

New Member
Joined
Dec 13, 2017
Messages
3
Hi all,

I hope you can help me with the following;

I need a formula that will look at staff Headcount, and start and finish times, and based on that.... fill out a Headcount requirement by hours. (taking the highest headcount within that hour)

So, the source of the data looks like this:

[TABLE="width: 298"]
<tbody>[TR]
[TD]STAFF[/TD]
[TD]START TIME [/TD]
[TD]FINISH[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]6:00[/TD]
[TD]6:44[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]6:59[/TD]
[TD]7:58[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]8:13[/TD]
[TD]8:57[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]9:12[/TD]
[TD]10:47[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]11:17[/TD]
[TD]11:17[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]11:17[/TD]
[TD]11:32[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]11:47[/TD]
[TD]12:59[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]13:14[/TD]
[TD]14:11[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]14:26[/TD]
[TD]14:59[/TD]
[/TR]
</tbody><colgroup><col><col span="2"></colgroup>[/TABLE]


and I need a formula system that would give me a result like the below:

[TABLE="width: 160"]
<tbody>[TR]
[TD]TIME[/TD]
[TD]STAFF[/TD]
[/TR]
[TR]
[TD]6:00[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]7:00[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]8:00[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]9:00[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]10:00[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]11:00[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]12:00[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]13:00[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]14:00[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]15:00[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]16:00[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]17:00[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]18:00[/TD]
[TD]0[/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]


Kind Regards,

Kully Singh
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
This seems to work

=MAX(IF((HOUR(E1)>=HOUR(B$1:B$10))*(HOUR(E1)<=HOUR(C$1:C$10)),A$1:A$10))
Array formula, use Ctrl-Shift-Enter
and copy down the column

where column E are your hourly times
 
Upvote 0
Hey thanks for your reply but this doesnt seem to work for me.

I have column E as my hourly column

Column A is staff headcount
Column B is my start time
Column C is my finish time.

Its giving me a #Value result
 
Upvote 0
Sorry my fault. I was including column titles in the formula. It works great. Thank you so much for your guidance :D
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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