# Counting cells that have a time

Discussion in 'Excel Beginners' started by Petteri, Feb 26, 2014.

1. ### PetteriGuest

Hello,

I'm creating a spreadsheet to come up with an employee schedule. I'v
gotten the basics down. I'm able to calculate the hours worked per wee
and per day. What I'd like to do, to really make it easier to work wit
going forward is to be able to count the number of staff scheduled fo
any given shift, based on start time.

I've only got basic excel knowledge and this seems to be beyond m
ability to figure out. I've tried searching here and other places, bu
just can't seem to find a solution. Hopefully someone here can assis
me.

Are attaching excel files here frowned upon? It doesn't seem to be a
option. I can zip it if that helps.

Thank you!

Petteri, Feb 26, 2014

2. ### Claus BuschGuest

Hi,

Am Wed, 26 Feb 2014 16:45:47 +0000 schrieb Petteri:
you can attach a zipped excel workbook

If your times are in column B and you want to count the time 8:00 try:
=COUNTIF(B1:B100,TIME(8,,))
If your names are in column A and time in B you can also try for
existing names at 8:00
=SUMPRODUCT(--(B1:B100=TIME(8,,)),--(A1:A100<>""))

Regards
Claus B.

Claus Busch, Feb 27, 2014

3. ### PetteriGuest

Thanks,

I solved it with a combination of COUNTIFs like this:

=COUNTIF(D47,">12:00")+COUNTIF(D1725,">12:00")-COUNTIF(D1725,">19:00")

Thanks again!

Petteri, Feb 27, 2014